mirror of
https://github.com/Updated-NoCheatPlus/NoCheatPlus.git
synced 2026-11-08 09:35:18 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a64a90f42 | ||
|
|
69276a1315 | ||
|
|
c4331e1ffd | ||
|
|
95fb0d2494 | ||
|
|
7d421b5289 | ||
|
|
c155042a75 | ||
|
|
56af2482de | ||
|
|
5129a2df0a | ||
|
|
e5eec8905a | ||
|
|
71ba3ee690 | ||
|
|
3ecc4a89f1 | ||
|
|
0ac72f653a | ||
|
|
9fd079f24a | ||
|
|
aafb786518 | ||
|
|
1475915222 | ||
|
|
b2e62180bd | ||
|
|
b71c113440 | ||
|
|
1ba40eb66c | ||
|
|
713af9fd47 | ||
|
|
3137ce938d | ||
|
|
1dc8bcff71 | ||
|
|
f6fab19e99 | ||
|
|
141bb548a5 | ||
|
|
16465bff7f | ||
|
|
0e9f1f6ba3 | ||
|
|
d16be6b8db | ||
|
|
8433a983c0 | ||
|
|
cafa7d1015 | ||
|
|
187ee39e31 | ||
|
|
f8ecb8b8e8 | ||
|
|
8c192a0be9 | ||
|
|
eaee221150 | ||
|
|
72bd9483cb | ||
|
|
8daea7978c | ||
|
|
97522875e1 | ||
|
|
40daa9bb19 | ||
|
|
01eb504cde | ||
|
|
74a6a1ffc2 | ||
|
|
6f557b58fc | ||
|
|
0ba9540700 | ||
|
|
e7abf96e4b | ||
|
|
6f748c2fd1 | ||
|
|
b891313f80 | ||
|
|
097e36f50e | ||
|
|
4a19cd6b22 | ||
|
|
77559a7b5f | ||
|
|
e377abe342 | ||
|
|
f22055bf81 | ||
|
|
90d9aa740f | ||
|
|
ae980a1936 | ||
|
|
78190886d8 | ||
|
|
0b885f1061 | ||
|
|
bec522d41b | ||
|
|
5050724f6f | ||
|
|
97fdd00a18 | ||
|
|
77eeb66d7e | ||
|
|
8771c894bf | ||
|
|
fc2d86d87d | ||
|
|
73c14dda4d | ||
|
|
1ddfa28470 | ||
|
|
2e4cfe5957 | ||
|
|
4138b346bf | ||
|
|
18da617e05 | ||
|
|
282ef7c6be | ||
|
|
7910f6c771 | ||
|
|
9af10564b2 | ||
|
|
7dcf8e4333 | ||
|
|
a78b7833c6 | ||
|
|
7053d0a0c7 | ||
|
|
f5c7d7adc6 | ||
|
|
5527a65288 | ||
|
|
7c83c8af36 | ||
|
|
133f480a7b | ||
|
|
d9ed26a45f | ||
|
|
9828c7e2be | ||
|
|
68f187e38c | ||
|
|
5116bdbdb3 | ||
|
|
ac6b3dbe43 | ||
|
|
49d3a119f7 | ||
|
|
61b1227596 |
No files matched your search
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ public class BlockCacheBukkit extends BlockCache {
|
||||
// TODO: Probably check other ids too before doing this ?
|
||||
for (final Entity other : entity.getNearbyEntities(2.0, 2.0, 2.0)){
|
||||
final EntityType type = other.getType();
|
||||
if (type != EntityType.BOAT){ // && !(other instanceof Minecart))
|
||||
if (type != EntityType.BOAT && type != EntityType.SHULKER){ // && !(other instanceof Minecart))
|
||||
continue;
|
||||
}
|
||||
final double locY = entity.getLocation(useLoc).getY();
|
||||
@@ -97,4 +97,4 @@ public class BlockCacheBukkit extends BlockCache {
|
||||
world = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+7
-2
@@ -78,7 +78,9 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
private static final BukkitShapeModel MODEL_GROUND_HEAD= new BukkitStatic(
|
||||
0.25, 0.5); // TODO: XZ-really? 275 ?
|
||||
private static final BukkitShapeModel MODEL_SINGLE_CHEST = new BukkitStatic(
|
||||
0.062, .875); // TODO: 0.0625?
|
||||
0.0625, 0.875);
|
||||
private static final BukkitShapeModel MODEL_HONEY_BLOCK = new BukkitStatic(
|
||||
0.0625, 0.9375);
|
||||
|
||||
// Static blocks with full height sorted by inset.
|
||||
private static final BukkitShapeModel MODEL_INSET16_1_HEIGHT100 = new BukkitStatic(
|
||||
@@ -122,7 +124,7 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
return "1.13-1.14.4|?";
|
||||
return "1.13.2-1.15|?";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -343,6 +345,9 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
mt = BridgeMaterial.getBlock("bell");
|
||||
if (mt != null) addModel(mt, MODEL_BELL);
|
||||
|
||||
mt = BridgeMaterial.getBlock("honey_block");
|
||||
if (mt != null) addModel(mt, MODEL_HONEY_BLOCK);
|
||||
|
||||
// Sort to processed by flags.
|
||||
for (final Material mat : Material.values()) {
|
||||
final long flags = BlockProperties.getBlockFlags(mat);
|
||||
|
||||
+9
-8
@@ -21,25 +21,26 @@ import org.bukkit.block.Block;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitBamboo implements BukkitShapeModel {
|
||||
private DecimalFormat df = new DecimalFormat("#.000");
|
||||
private final double xz = 0.375;
|
||||
//private DecimalFormat df = new DecimalFormat("#.000");
|
||||
//private final double xz = 0.375;
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
//final Block block = world.getBlockAt(x, y, z);
|
||||
|
||||
double minX = Math.abs(block.getBoundingBox().getMinX()) - Math.abs((int) block.getBoundingBox().getMinX());
|
||||
double minZ = Math.abs(block.getBoundingBox().getMinZ()) - Math.abs((int) block.getBoundingBox().getMinZ());
|
||||
//double minX = Math.abs(block.getBoundingBox().getMinX()) - Math.abs((int) block.getBoundingBox().getMinX());
|
||||
//double minZ = Math.abs(block.getBoundingBox().getMinZ()) - Math.abs((int) block.getBoundingBox().getMinZ());
|
||||
|
||||
minX = Double.parseDouble(df.format(minX));
|
||||
minZ = Double.parseDouble(df.format(minZ));
|
||||
//minX = Double.parseDouble(df.format(minX));
|
||||
//minZ = Double.parseDouble(df.format(minZ));
|
||||
|
||||
//return new double[] {1.0 - minX + 0.09, 0.0, minZ + 0.09, 1.0 - minX + xz - 0.09, 1.0, minZ + xz - 0.09}; (1)
|
||||
//return new double[] {minX + 0.09, 0.0, 1.0 - minZ + 0.09, minX + xz - 0.09, 1.0, 1.0 - minZ + xz - 0.09}; (2)
|
||||
// (1) + (2) =>
|
||||
return new double[] {1.0 - minX + 0.09, 0.0, 1.0 - minZ + 0.09, 1.0 - minX + xz - 0.09, 1.0, 1.0 - minZ + xz - 0.09};
|
||||
//return new double[] {1.0 - minX + 0.09, 0.0, 1.0 - minZ + 0.09, 1.0 - minX + xz - 0.09, 1.0, 1.0 - minZ + xz - 0.09};
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+17
-7
@@ -19,7 +19,6 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.Bisected.Half;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Openable;
|
||||
import org.bukkit.block.data.type.TrapDoor;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
@@ -67,12 +66,23 @@ public class BukkitTrapDoor implements BukkitShapeModel {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Openable) {
|
||||
return ((Openable) blockData).isOpen() ? 0x4 : 0;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
if (blockData instanceof TrapDoor) {
|
||||
final TrapDoor trapDoor = (TrapDoor) blockData;
|
||||
if (trapDoor.isOpen()) {
|
||||
switch(trapDoor.getFacing()) {
|
||||
case EAST:
|
||||
return 3;
|
||||
case NORTH:
|
||||
return 4;
|
||||
case SOUTH:
|
||||
return 5;
|
||||
case WEST:
|
||||
return 6;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.12-pre2-SNAPSHOT</version>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.comphenix.protocol</groupId>
|
||||
<artifactId>ProtocolLib-API</artifactId>
|
||||
<version>4.3.0-SNAPSHOT</version>
|
||||
<artifactId>ProtocolLib</artifactId>
|
||||
<version>4.5.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<description>Features using the plugin ProtocolLib:
|
||||
<description>Features using the plugin ProtocolLib:
|
||||
https://dev.bukkit.org/bukkit-plugins/protocollib/</description>
|
||||
|
||||
<build>
|
||||
@@ -56,4 +56,4 @@ https://dev.bukkit.org/bukkit-plugins/protocollib/</description>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+1
@@ -68,6 +68,7 @@ public class CatchAllAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final Player player = event.getPlayer();
|
||||
if (player == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public class DebugAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final Player player = event.getPlayer();
|
||||
if (DataManager.getPlayerDataSafe(player).isDebugActive(CheckType.NET)) {
|
||||
debug(player, "packet: " + event.getPacketType());
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.net.protocollib;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.fight.FightData;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
|
||||
public class Fight extends BaseAdapter{
|
||||
private static PacketType[] initPacketTypes() {
|
||||
final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(
|
||||
PacketType.Play.Client.ARM_ANIMATION
|
||||
));
|
||||
return types.toArray(new PacketType[types.size()]);
|
||||
}
|
||||
|
||||
public Fight(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, initPacketTypes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
handleAnmationPacket(event);
|
||||
}
|
||||
|
||||
public void handleAnmationPacket(final PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final FightData data = DataManager.getGenericInstance(event.getPlayer(), FightData.class);
|
||||
data.noSwingPacket = true;
|
||||
data.noSwingArmSwung = true;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -57,7 +57,8 @@ public class KeepAliveAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
final long time = System.currentTimeMillis();
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final long time = System.currentTimeMillis();
|
||||
final Player player = event.getPlayer();
|
||||
if (player == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
|
||||
+55
-3
@@ -21,6 +21,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@@ -34,6 +35,7 @@ import com.comphenix.protocol.reflect.StructureModifier;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.net.FlyingFrequency;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
@@ -41,6 +43,7 @@ import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying.PACKET_CONTENT;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.TeleportQueue.AckReference;
|
||||
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
@@ -50,6 +53,7 @@ import fr.neatmonster.nocheatplus.utilities.CheckUtils;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.TrigUtil;
|
||||
import fr.neatmonster.nocheatplus.worlds.IWorldData;
|
||||
|
||||
/**
|
||||
@@ -72,6 +76,8 @@ public class MovingFlying extends BaseAdapter {
|
||||
public static final int indexStance = 3;
|
||||
public static final int indexYaw = 0;
|
||||
public static final int indexPitch = 1;
|
||||
|
||||
private final Plugin plugin = Bukkit.getPluginManager().getPlugin("NoCheatPlus");
|
||||
|
||||
private static PacketType[] initPacketTypes() {
|
||||
final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(
|
||||
@@ -82,7 +88,7 @@ public class MovingFlying extends BaseAdapter {
|
||||
));
|
||||
// Add confirm teleport.
|
||||
// PacketPlayInTeleportAccept
|
||||
PacketType confirmType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "PacketPlayInTeleportAccept");
|
||||
PacketType confirmType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "TeleportAccept");
|
||||
if (confirmType != null) {
|
||||
StaticLog.logInfo("Confirm teleport packet available (via name): " + confirmType);
|
||||
types.add(confirmType);
|
||||
@@ -105,7 +111,7 @@ public class MovingFlying extends BaseAdapter {
|
||||
private long packetMismatchLogFrequency = 60000; // Every minute max, good for updating :).
|
||||
|
||||
private final HashSet<PACKET_CONTENT> validContent = new LinkedHashSet<PACKET_CONTENT>();
|
||||
private final PacketType confirmTeleportType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "PacketPlayInTeleportAccept");
|
||||
private final PacketType confirmTeleportType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "TeleportAccept");
|
||||
private boolean acceptConfirmTeleportPackets = confirmTeleportType != null;
|
||||
|
||||
public MovingFlying(Plugin plugin) {
|
||||
@@ -123,7 +129,7 @@ public class MovingFlying extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
|
||||
if (event.isPlayerTemporary()) return;
|
||||
if (event.getPacketType().equals(confirmTeleportType)) {
|
||||
if (acceptConfirmTeleportPackets) {
|
||||
onConfirmTeleportPacket(event);
|
||||
@@ -223,6 +229,52 @@ public class MovingFlying extends BaseAdapter {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Should let it here?
|
||||
// Work as ExtremeMove but for packet sent!
|
||||
if (packetData.hasPos) {
|
||||
final MovingData Mdata = pData.getGenericInstance(MovingData.class);
|
||||
final Location loc1 = player.getLocation();
|
||||
final Location loc2 = new Location(null, packetData.getX(), packetData.getY(), packetData.getZ());
|
||||
final double xzdist = TrigUtil.distance(loc1, loc2);
|
||||
final double amount = xzdist - Mdata.getHorizontalFreedom();
|
||||
final double ydist = Math.abs(loc1.getY() - loc2.getY());
|
||||
final boolean allowVerticalVelocity = true; // TODO: Configurable
|
||||
final boolean allowHorizontalVelocity = true; // TODO: Configurable
|
||||
|
||||
// Vertical move.
|
||||
if (ydist > 100.0 && !(allowVerticalVelocity && Mdata.getOrUseVerticalVelocity(ydist) != null)) {
|
||||
++data.diffpacketVLs;
|
||||
}
|
||||
// Horizontal move.
|
||||
else if (amount > 100.0 && !(allowHorizontalVelocity && Mdata.useHorizontalVelocity(amount) >= amount)) {
|
||||
++data.diffpacketVLs;
|
||||
} else data.diffpacketVLs *= 0.98;
|
||||
|
||||
if (data.diffpacketVLs > 7) {
|
||||
cancel = true;
|
||||
}
|
||||
if (data.diffpacketVLs > 15) {
|
||||
// Player might be freezed by canceling, set back might turn it to normal
|
||||
|
||||
data.diffpacketVLs = 0.0;
|
||||
int task = -1;
|
||||
task = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin,
|
||||
(Runnable)new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Mask player teleport as a set back.
|
||||
Mdata.prepareSetBack(loc1);
|
||||
player.teleport(LocUtil.clone(loc1),
|
||||
BridgeMisc.TELEPORT_CAUSE_CORRECTION_OF_POSITION);
|
||||
}
|
||||
});
|
||||
if (task == -1) {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().warning(Streams.STATUS, "Failed to schedule set back task. Player: " + player.getName() + " , set back: " + loc1);
|
||||
}
|
||||
Mdata.resetTeleported(); // Cleanup, just in case.
|
||||
}
|
||||
}
|
||||
switch(data.teleportQueue.processAck(packetData)) {
|
||||
case WAITING: {
|
||||
if (pData.isDebugActive(this.checkType)) {
|
||||
|
||||
+132
-111
@@ -21,10 +21,12 @@ import java.util.List;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.Ageable;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
@@ -50,14 +52,14 @@ import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.InventoryUtil;
|
||||
|
||||
public class NoSlow extends BaseAdapter {
|
||||
private final static String dftag = "system.nocheatplus.noslow";
|
||||
private final static MiniListener<?>[] miniListeners = new MiniListener<?>[] {
|
||||
private final static String dftag = "system.nocheatplus.noslow";
|
||||
private final static MiniListener<?>[] miniListeners = new MiniListener<?>[] {
|
||||
new MiniListener<PlayerItemConsumeEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerItemConsumeEvent event) {
|
||||
onItemConsume(event);
|
||||
onItemConsume(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<PlayerInteractEvent>() {
|
||||
@@ -65,7 +67,7 @@ public class NoSlow extends BaseAdapter {
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerInteractEvent event) {
|
||||
onItemInteract(event);
|
||||
onItemInteract(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<InventoryOpenEvent>() {
|
||||
@@ -73,7 +75,7 @@ public class NoSlow extends BaseAdapter {
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final InventoryOpenEvent event) {
|
||||
onInventoryOpen(event);
|
||||
onInventoryOpen(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<PlayerItemHeldEvent>() {
|
||||
@@ -81,109 +83,128 @@ public class NoSlow extends BaseAdapter {
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerItemHeldEvent event) {
|
||||
onChangeSlot(event);
|
||||
onChangeSlot(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<BlockPlaceEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final BlockPlaceEvent event) {
|
||||
onPlace(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static int timeBetweenRL = 53;
|
||||
private static PacketType[] initPacketTypes() {
|
||||
|
||||
private static int timeBetweenRL = 70;
|
||||
private static PacketType[] initPacketTypes() {
|
||||
final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(
|
||||
PacketType.Play.Client.BLOCK_DIG
|
||||
PacketType.Play.Client.BLOCK_DIG
|
||||
));
|
||||
return types.toArray(new PacketType[types.size()]);
|
||||
}
|
||||
|
||||
public NoSlow(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, initPacketTypes());
|
||||
final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
|
||||
for (final MiniListener<?> listener : miniListeners) {
|
||||
api.addComponent(listener, false);
|
||||
|
||||
public NoSlow(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, initPacketTypes());
|
||||
final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
|
||||
for (final MiniListener<?> listener : miniListeners) {
|
||||
api.addComponent(listener, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
handleDiggingPacket(event);
|
||||
if (event.isPlayerTemporary()) return;
|
||||
handleDiggingPacket(event);
|
||||
}
|
||||
|
||||
private static void onItemConsume(final PlayerItemConsumeEvent e){
|
||||
final Player p = e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
|
||||
private static void onItemConsume(final PlayerItemConsumeEvent e){
|
||||
final Player p = e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onInventoryOpen(final InventoryOpenEvent e){
|
||||
if (e.isCancelled()) return;
|
||||
final Player p = (Player) e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onItemInteract(final PlayerInteractEvent e){
|
||||
if (e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
Block b = e.getClickedBlock();
|
||||
if (p.getGameMode() == GameMode.CREATIVE) {
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (b != null && (
|
||||
b.getType().toString().endsWith("DOOR")
|
||||
|| b.getType().toString().endsWith("GATE")
|
||||
|| b.getType().toString().endsWith("BUTTON")
|
||||
|| b.getType().toString().endsWith("LEVER")
|
||||
)) {
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (e.hasItem()) {
|
||||
ItemStack item = e.getItem();
|
||||
Material m = item.getType();
|
||||
if (InventoryUtil.isConsumable(item)) {
|
||||
if (m == Material.POTION || m == Material.MILK_BUCKET || m.toString().endsWith("_APPLE")) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
if (item.getType().isEdible() && p.getFoodLevel() < 20) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (m.toString().equals("BOW") && hasArrow(p.getInventory())) {
|
||||
data.isusingitem = true;
|
||||
}
|
||||
if (m.toString().equals("CROSSBOW")) {
|
||||
if (item.getItemMeta().serialize().get("charged").equals(false) && hasArrow(p.getInventory())) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onChangeSlot(final PlayerItemHeldEvent e) {
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
if (e.isCancelled()) return;
|
||||
final Player p = (Player) e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
|
||||
private static void onItemInteract(final PlayerInteractEvent e){
|
||||
if (e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
Block b = e.getClickedBlock();
|
||||
if (p.getGameMode() == GameMode.CREATIVE) {
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (b != null && (
|
||||
b.getType().toString().endsWith("DOOR")
|
||||
|| b.getType().toString().endsWith("GATE")
|
||||
|| b.getType().toString().endsWith("BUTTON")
|
||||
|| b.getType().toString().endsWith("LEVER")
|
||||
|| (b.getType().name().startsWith("SWEET_BERRY_BUSH") && ((Ageable) b.getBlockData()).getAge() > 1)
|
||||
)) {
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (e.hasItem()) {
|
||||
ItemStack item = e.getItem();
|
||||
Material m = item.getType();
|
||||
if (InventoryUtil.isConsumable(item)) {
|
||||
// pre1.9 splash potion
|
||||
if (item.getDurability() > 16384) return;
|
||||
if (m == Material.POTION || m == Material.MILK_BUCKET || m.toString().endsWith("_APPLE") || m.name().startsWith("HONEY_BOTTLE")) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
if (item.getType().isEdible() && p.getFoodLevel() < 20) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (m.toString().equals("BOW") && hasArrow(p.getInventory())) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
if (m.toString().equals("CROSSBOW")) {
|
||||
if (item.getItemMeta().serialize().get("charged").equals(false) && hasArrow(p.getInventory())) {
|
||||
data.isusingitem = true;
|
||||
}
|
||||
}
|
||||
} else data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onChangeSlot(final PlayerItemHeldEvent e) {
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onPlace(final BlockPlaceEvent e) {
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
if (InventoryUtil.isConsumable(e.getItemInHand())) data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static boolean hasArrow(PlayerInventory i) {
|
||||
if (Bridge1_9.hasElytra()) {
|
||||
Material m = i.getItemInOffHand().getType();
|
||||
return i.contains(Material.ARROW) || m.toString().endsWith("ARROW") || i.contains(Material.TIPPED_ARROW) || i.contains(Material.SPECTRAL_ARROW);
|
||||
}
|
||||
return i.contains(Material.ARROW);
|
||||
}
|
||||
|
||||
private void handleDiggingPacket(PacketEvent event)
|
||||
if (Bridge1_9.hasElytra()) {
|
||||
Material m = i.getItemInOffHand().getType();
|
||||
return i.contains(Material.ARROW) || m.toString().endsWith("ARROW") || i.contains(Material.TIPPED_ARROW) || i.contains(Material.SPECTRAL_ARROW);
|
||||
}
|
||||
return i.contains(Material.ARROW);
|
||||
}
|
||||
|
||||
private void handleDiggingPacket(PacketEvent event)
|
||||
{
|
||||
if(event.getPacketType() != PacketType.Play.Client.BLOCK_DIG) return;
|
||||
|
||||
@@ -204,22 +225,22 @@ public class NoSlow extends BaseAdapter {
|
||||
|
||||
//Advanced check
|
||||
if(digtype == PlayerDigType.RELEASE_USE_ITEM) {
|
||||
long now = System.currentTimeMillis();
|
||||
if (data.time_rl_item != 0) {
|
||||
if (now < data.time_rl_item) {
|
||||
data.time_rl_item = now;
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (data.time_rl_item + timeBetweenRL > now) {
|
||||
data.isHackingRI = true;
|
||||
}
|
||||
}
|
||||
data.time_rl_item = now;
|
||||
long now = System.currentTimeMillis();
|
||||
if (data.time_rl_item != 0) {
|
||||
if (now < data.time_rl_item) {
|
||||
data.time_rl_item = now;
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (data.time_rl_item + timeBetweenRL > now) {
|
||||
data.isHackingRI = true;
|
||||
}
|
||||
}
|
||||
data.time_rl_item = now;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Set Minimum time between RELEASE_USE_ITEM packet is sent.
|
||||
* If time lower this value, A check will flag
|
||||
* Should be set from 51-100. Larger number, more protection more false-positive
|
||||
@@ -227,6 +248,6 @@ public class NoSlow extends BaseAdapter {
|
||||
* @param milliseconds
|
||||
*/
|
||||
public static void setuseRLThreshold(int time) {
|
||||
timeBetweenRL = time;
|
||||
timeBetweenRL = time;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -54,7 +54,8 @@ public class OutgoingPosition extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
final long time = System.currentTimeMillis();
|
||||
|
||||
+4
@@ -126,6 +126,9 @@ public class ProtocolLibComponent implements IDisableListener, INotifyReload, Jo
|
||||
}
|
||||
if (worldMan.isActiveAnywhere(CheckType.NET_SOUNDDISTANCE)) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.SoundDistance", plugin);
|
||||
}
|
||||
if (worldMan.isActiveAnywhere(CheckType.NET_WRONGTURN)) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.WrongTurnAdapter", plugin);
|
||||
}
|
||||
if (ServerVersion.compareMinecraftVersion("1.9") < 0) {
|
||||
if (worldMan.isActiveAnywhere(CheckType.NET_PACKETFREQUENCY)) {
|
||||
@@ -134,6 +137,7 @@ public class ProtocolLibComponent implements IDisableListener, INotifyReload, Jo
|
||||
}
|
||||
if (ServerVersion.compareMinecraftVersion("1.8") >= 0) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.NoSlow", plugin);
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.Fight", plugin);
|
||||
}
|
||||
if (!registeredPacketAdapters.isEmpty()) {
|
||||
List<String> names = new ArrayList<String>(registeredPacketAdapters.size());
|
||||
|
||||
+1
@@ -142,6 +142,7 @@ public class SoundDistance extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketSending(final PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final PacketContainer packetContainer = event.getPacket();
|
||||
|
||||
// Compare sound effect name.
|
||||
|
||||
+1
-1
@@ -123,6 +123,7 @@ public class UseEntityAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final long time = System.currentTimeMillis();
|
||||
final Player player = event.getPlayer();
|
||||
if (player == null) {
|
||||
@@ -134,7 +135,6 @@ public class UseEntityAdapter extends BaseAdapter {
|
||||
final NetData data = pData.getGenericInstance(NetData.class);
|
||||
// Always set last received time.
|
||||
data.lastKeepAliveTime = time;
|
||||
data.lastHitLocation = player.getLocation();
|
||||
|
||||
// Quick return, if no checks are active.
|
||||
if (!pData.isCheckActive(CheckType.NET_ATTACKFREQUENCY, player)) {
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package fr.neatmonster.nocheatplus.checks.net.protocollib;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.reflect.StructureModifier;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
import fr.neatmonster.nocheatplus.checks.net.WrongTurn;
|
||||
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
||||
import fr.neatmonster.nocheatplus.config.ConfigManager;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
|
||||
public class WrongTurnAdapter extends BaseAdapter {
|
||||
|
||||
private final WrongTurn wrongTurn = new WrongTurn();
|
||||
|
||||
public WrongTurnAdapter(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, PacketType.Play.Client.LOOK, PacketType.Play.Client.POSITION_LOOK);
|
||||
if (ConfigManager.isTrueForAnyConfig(ConfPaths.NET_WRONGTURN_ACTIVE)) {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().addFeatureTags("checks", Arrays.asList(WrongTurn.class.getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
final StructureModifier<Float> floats = event.getPacket().getFloat();
|
||||
final float pitch = floats.read(1);
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final NetData data = pData.getGenericInstance(NetData.class);
|
||||
final NetConfig cc = pData.getGenericInstance(NetConfig.class);
|
||||
|
||||
if (pData.isCheckActive(CheckType.NET_WRONGTURN, player) && wrongTurn.check(player, pitch, data, cc)) {
|
||||
event.setCancelled(true); // Is it a good idea to cancel or should we just reset the players pitch?
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -72,7 +72,6 @@ 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),
|
||||
@@ -90,7 +89,8 @@ public enum CheckType {
|
||||
INVENTORY_GUTENBERG(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_GUTENBERG),
|
||||
INVENTORY_INSTANTBOW(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_INSTANTBOW),
|
||||
INVENTORY_INSTANTEAT(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_INSTANTEAT),
|
||||
INVENTORY_MOVE(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_MOVE),
|
||||
INVENTORY_INVENTORYMOVE(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_INVENTORYMOVE),
|
||||
INVENTORY_MOREINVENTORY(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_MOREINVENTORY),
|
||||
INVENTORY_ITEMS(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_ITEMS),
|
||||
INVENTORY_OPEN(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_OPEN),
|
||||
|
||||
@@ -106,11 +106,11 @@ public enum CheckType {
|
||||
|
||||
NET(CheckTypeType.GROUP, CheckType.ALL, Permissions.NET),
|
||||
NET_ATTACKFREQUENCY(CheckTypeType.CHECK, NET, Permissions.NET_ATTACKFREQUENCY),
|
||||
NET_FIGHTSYNC(CheckTypeType.CHECK, NET, Permissions.NET_FLYINGFREQUENCY),
|
||||
NET_FLYINGFREQUENCY(CheckTypeType.CHECK, NET, Permissions.NET_FLYINGFREQUENCY),
|
||||
NET_KEEPALIVEFREQUENCY(CheckTypeType.CHECK, NET, Permissions.NET_KEEPALIVEFREQUENCY),
|
||||
NET_PACKETFREQUENCY(CheckTypeType.CHECK, NET, Permissions.NET_PACKETFREQUENCY),
|
||||
NET_SOUNDDISTANCE(CheckTypeType.CHECK, NET), // Can not exempt players from this one.
|
||||
NET_WRONGTURN(CheckTypeType.CHECK, NET, Permissions.NET_WRONGTURN),
|
||||
|
||||
;
|
||||
|
||||
|
||||
+2
-2
@@ -232,7 +232,7 @@ public class BlockBreakListener extends CheckListener {
|
||||
}
|
||||
|
||||
// Destroying liquid blocks.
|
||||
if (!cancelled && BlockProperties.isLiquid(block.getType())
|
||||
if (!cancelled && BlockProperties.isLiquid(block.getType()) && !BlockProperties.isNewLiq(block.getType())
|
||||
&& !pData.hasPermission(Permissions.BLOCKBREAK_BREAK_LIQUID, player)
|
||||
&& !NCPExemptionManager.isExempted(player, CheckType.BLOCKBREAK_BREAK)){
|
||||
cancelled = true;
|
||||
@@ -409,4 +409,4 @@ public class BlockBreakListener extends CheckListener {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -378,8 +378,9 @@ public class BlockInteractListener extends CheckListener {
|
||||
if (stack != null && BridgeMisc.maybeElytraBoost(player, stack.getType())) {
|
||||
final int power = BridgeMisc.getFireworksPower(stack);
|
||||
final MovingData mData = pData.getGenericInstance(MovingData.class);
|
||||
final int ticks = Math.max((1 + power) * 20, 30);
|
||||
final int ticks = Math.max((1 + power) * 15, 30);
|
||||
mData.fireworksBoostDuration = ticks;
|
||||
mData.fireworksBoostTickNeedCheck = ticks - 1;
|
||||
// Expiration tick: not general latency, rather a minimum margin for sudden congestion.
|
||||
mData.fireworksBoostTickExpire = TickTask.getTick() + ticks;
|
||||
// TODO: Invalidation mechanics: by tick/time well ?
|
||||
@@ -438,4 +439,4 @@ public class BlockInteractListener extends CheckListener {
|
||||
debug(player, builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -70,11 +70,17 @@ public class Against extends Check {
|
||||
else if (BlockProperties.isLiquid(againstType)) {
|
||||
// TODO: F_PLACE_AGAINST_WATER|LIQUID...
|
||||
if ((placedMat != BridgeMaterial.LILY_PAD
|
||||
|| !BlockProperties.isLiquid(block.getRelative(BlockFace.DOWN).getType()))
|
||||
|| !BlockProperties.isLiquid(block.getRelative(BlockFace.DOWN).getType()))
|
||||
&& !BlockProperties.isNewLiq(bdata.getLastType())
|
||||
&& !pData.hasPermission(Permissions.BLOCKPLACE_AGAINST_LIQUIDS, player)) {
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
// Replace block placed by block placed and interact with air or water
|
||||
if (block.equals(blockAgainst) && (bdata.getLastType() == null || (BlockProperties.isLiquid(bdata.getLastType()) && !BlockProperties.isNewLiq(bdata.getLastType())))
|
||||
&& !pData.hasPermission(Permissions.BLOCKPLACE_AGAINST_SELF, player)) {
|
||||
violation = true;
|
||||
}
|
||||
// Handle violation and return.
|
||||
bdata.addConsumedCheck(this.type);
|
||||
if (violation) {
|
||||
@@ -90,4 +96,4 @@ public class Against extends Check {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+9
-3
@@ -50,8 +50,11 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
public final ActionList noSwingActions;
|
||||
|
||||
public final ActionList reachActions;
|
||||
|
||||
|
||||
public final ActionList scaffoldActions;
|
||||
public final boolean scaffoldAngle;
|
||||
public final boolean scaffoldTime;
|
||||
public final boolean scaffoldSprint;
|
||||
|
||||
public final long speedInterval;
|
||||
public final boolean speedImprobableFeedOnly;
|
||||
@@ -90,8 +93,11 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
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);
|
||||
scaffoldAngle = config.getBoolean(ConfPaths.BLOCKPLACE_SCAFFOLD_ANGLE);
|
||||
scaffoldTime = config.getBoolean(ConfPaths.BLOCKPLACE_SCAFFOLD_TIME);
|
||||
scaffoldSprint = config.getBoolean(ConfPaths.BLOCKPLACE_SCAFFOLD_SPRINT);
|
||||
|
||||
speedInterval = config.getLong(ConfPaths.BLOCKPLACE_SPEED_INTERVAL);
|
||||
speedImprobableFeedOnly = config.getBoolean(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_FEEDONLY);
|
||||
@@ -108,4 +114,4 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+11
-1
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.blockplace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.access.ACheckData;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency;
|
||||
|
||||
@@ -37,6 +39,14 @@ public class BlockPlaceData extends ACheckData {
|
||||
/** Using Material.SIGN . */
|
||||
public long autoSignPlacedHash = 0;
|
||||
|
||||
// Scaffold data
|
||||
public long lastPlaceTime = 0;
|
||||
public long lastPlaceAvg = 0;
|
||||
public ArrayList<Long> placeTime = new ArrayList<Long>();
|
||||
public long sneakTime = 0;
|
||||
public long sprintTime = 0;
|
||||
public boolean cancelNextPlace = false;
|
||||
|
||||
// Data of the fast place check.
|
||||
public final ActionFrequency fastPlaceBuckets = new ActionFrequency(2, 1000);
|
||||
public int fastPlaceShortTermTick = 0;
|
||||
@@ -52,4 +62,4 @@ public class BlockPlaceData extends ACheckData {
|
||||
public boolean speedLastRefused;
|
||||
public long speedLastTime;
|
||||
|
||||
}
|
||||
}
|
||||
+43
-29
@@ -34,6 +34,7 @@ import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
@@ -114,7 +115,7 @@ public class BlockPlaceListener extends CheckListener {
|
||||
|
||||
/** The scaffold check. */
|
||||
private final Scaffold Scaffold = addCheck(new Scaffold());
|
||||
|
||||
|
||||
/** The speed check. */
|
||||
private final Speed speed = addCheck(new Speed());
|
||||
|
||||
@@ -201,6 +202,12 @@ public class BlockPlaceListener extends CheckListener {
|
||||
int skippedRedundantChecks = 0;
|
||||
final boolean debug = pData.isDebugActive(CheckType.BLOCKPLACE);
|
||||
|
||||
final BlockFace placedFace = event.getBlock().getFace(event.getBlockAgainst());
|
||||
final Block blockPlaced = event.getBlockPlaced();
|
||||
// TODO: change to distsquared for possible performance boost
|
||||
final double distance = player.getLocation().distance(blockPlaced.getLocation());
|
||||
boolean shouldCheck = false;
|
||||
|
||||
final boolean shouldSkipSome;
|
||||
if (blockMultiPlaceEvent != null && event.getClass() == blockMultiPlaceEvent) {
|
||||
if (placedMat == Material.BEDROCK
|
||||
@@ -253,6 +260,24 @@ public class BlockPlaceListener extends CheckListener {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
switch (placedFace) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case EAST:
|
||||
case WEST:
|
||||
shouldCheck = true;
|
||||
break;
|
||||
default:
|
||||
shouldCheck = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Scaffold.isEnabled(player, pData) && player.getLocation().getY() - blockPlaced.getY() < 2D && blockPlaced.getType().isSolid() && shouldCheck && distance < 2D) {
|
||||
|
||||
cancelled = Scaffold.check(player, placedFace, pData, data, cc);
|
||||
|
||||
}
|
||||
|
||||
final FlyingQueueHandle flyingHandle;
|
||||
final boolean reachCheck = pData.isCheckActive(CheckType.BLOCKPLACE_REACH, player);
|
||||
final boolean directionCheck = pData.isCheckActive(CheckType.BLOCKPLACE_DIRECTION, player);
|
||||
@@ -270,6 +295,7 @@ public class BlockPlaceListener extends CheckListener {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Direction check.
|
||||
if (!cancelled && !shouldSkipSome) {
|
||||
if (isInteractBlock && bdata.isPassedCheck(CheckType.BLOCKINTERACT_DIRECTION)) {
|
||||
@@ -406,33 +432,6 @@ public class BlockPlaceListener extends CheckListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Listens for PlayerInteract events to check for their target block face vs their
|
||||
* attempted block face. This is used for the scaffold check.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void placeBlock(PlayerInteractEvent event) {
|
||||
if (ServerVersion.compareMinecraftVersion("1.8") < 0) return;
|
||||
if (!Scaffold.isEnabled(event.getPlayer())) return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK || !event.isBlockInHand() || player.isFlying() && player.getAllowFlight() || player.isSneaking()) return;
|
||||
Block targetBlock = player.getTargetBlock((Set<Material>) null, 7);
|
||||
if (targetBlock.isLiquid()) return;
|
||||
|
||||
List<Block> lastTarget = player.getLastTwoTargetBlocks((Set<Material>) null, 7);
|
||||
BlockFace blockFace = event.getBlockFace();
|
||||
|
||||
if (targetBlock.getY() != player.getLocation().subtract(0, 1, 0).getY()) return;
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final BlockPlaceData data = pData.getGenericInstance(BlockPlaceData.class);
|
||||
if (Scaffold.check(player, targetBlock, lastTarget, blockFace, pData, data)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkBoatsAnywhere(final Player player, final PlayerInteractEvent event,
|
||||
final BlockPlaceConfig cc, final IPlayerData pData) {
|
||||
@@ -573,4 +572,19 @@ public class BlockPlaceListener extends CheckListener {
|
||||
// Cleanup.
|
||||
useLoc.setWorld(null);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onMove(PlayerMoveEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final BlockPlaceData data = pData.getGenericInstance(BlockPlaceData.class);
|
||||
|
||||
if (player.isSprinting()) {
|
||||
data.sprintTime = System.currentTimeMillis();
|
||||
} else if (player.isSneaking()) {
|
||||
data.sneakTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +1,133 @@
|
||||
package fr.neatmonster.nocheatplus.checks.blockplace;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.checks.inventory.InventoryConfig;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
|
||||
public class Scaffold extends Check {
|
||||
|
||||
private final List<String> tags = new LinkedList<String>();
|
||||
|
||||
public Scaffold() {
|
||||
super(CheckType.BLOCKPLACE_SCAFFOLD);
|
||||
}
|
||||
|
||||
final static double MAX_ANGLE = Math.toRadians(90);
|
||||
|
||||
public boolean check(Player player, Block targetBlock, List<Block> lastTarget, BlockFace blockFace, final IPlayerData pData, final BlockPlaceData data) {
|
||||
BlockFace face = null;
|
||||
public boolean check(Player player, BlockFace placedFace, final IPlayerData pData, final BlockPlaceData data, final BlockPlaceConfig cc) {
|
||||
boolean cancel = false;
|
||||
|
||||
if (lastTarget.size() > 1) {
|
||||
face = lastTarget.get(1).getFace(lastTarget.get(0));
|
||||
final Vector placedVector = new Vector(placedFace.getModX(), placedFace.getModY(), placedFace.getModZ());
|
||||
float placedAngle = player.getLocation().getDirection().angle(placedVector);
|
||||
long now = System.currentTimeMillis();
|
||||
float pitchNow = player.getLocation().getPitch();
|
||||
int current = player.getInventory().getHeldItemSlot();
|
||||
|
||||
// Angle Check
|
||||
if (cc.scaffoldAngle && placedAngle > MAX_ANGLE) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("Angle");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
|
||||
// Average time check
|
||||
if (cc.scaffoldTime && data.sneakTime + 150 < now && !player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||
// TODO: need to make this more efficient
|
||||
if (data.placeTime.size() > 2) {
|
||||
long avg = 0;
|
||||
for (int i = 0; i < data.placeTime.size(); i++) {
|
||||
avg += data.placeTime.get(i);
|
||||
}
|
||||
avg = avg / data.placeTime.size();
|
||||
if (avg < 238L) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("Time");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
data.lastPlaceAvg = avg;
|
||||
data.placeTime.clear();
|
||||
data.lastPlaceTime = 0L;
|
||||
|
||||
} else {
|
||||
if (data.lastPlaceTime == 0) {
|
||||
data.lastPlaceTime = now;
|
||||
} else {
|
||||
long diff = now - data.lastPlaceTime;
|
||||
data.placeTime.add(diff);
|
||||
data.lastPlaceTime = now;
|
||||
if (diff <= data.lastPlaceAvg && data.lastPlaceAvg < 238L) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("TimeAvg");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (blockFace != face) {
|
||||
cancel = executeActions(player, data.scaffoldVL, 1D, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions).willCancel();
|
||||
|
||||
// Pitch Check
|
||||
//Bukkit.getScheduler().runTaskLater(data.plugin, checkDiff(player, now, pData, data), 2L);
|
||||
// Tool switch check
|
||||
// Bukkit.getScheduler().runTaskLater(data.plugin, checkTool(player, current, pData, data), 1L);
|
||||
|
||||
// Sprint check
|
||||
long diff = System.currentTimeMillis() - data.sprintTime;
|
||||
if (cc.scaffoldSprint && diff < 400) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("Sprint");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
|
||||
tags.clear();
|
||||
return cancel;
|
||||
}
|
||||
|
||||
// Check diff
|
||||
private void checkDiff(Player player, float now, final IPlayerData pData, final BlockPlaceData data) {
|
||||
float pitchNow = player.getLocation().getPitch();
|
||||
float diff = Math.abs(now - pitchNow);
|
||||
|
||||
if (diff > 20F) {
|
||||
executeActions(player, data.scaffoldVL, 1D, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void checkTool(Player player, int item, final IPlayerData pData, final BlockPlaceData data) {
|
||||
int newItem = player.getInventory().getHeldItemSlot();
|
||||
|
||||
if (newItem != item) {
|
||||
executeActions(player, data.scaffoldVL, 1D, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
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>();
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@ import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveInfo;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
@@ -64,52 +64,110 @@ public class Critical extends Check {
|
||||
boolean cancel = false;
|
||||
|
||||
final double mcFallDistance = (double) player.getFallDistance();
|
||||
final MovingData mData = pData.getGenericInstance(MovingData.class);
|
||||
|
||||
// Check if the hit was a critical hit (very small fall-distance, not on ladder,
|
||||
// not in liquid, not in vehicle, and without blindness effect).
|
||||
if (mcFallDistance > 0.0 && !player.isInsideVehicle()
|
||||
&& !player.hasPotionEffect(PotionEffectType.BLINDNESS)) {
|
||||
if (mcFallDistance > 0.0 && !player.isInsideVehicle() && !player.hasPotionEffect(PotionEffectType.BLINDNESS)) {
|
||||
|
||||
// Might be a violation.
|
||||
final MovingConfig mcc = pData.getGenericInstance(MovingConfig.class);
|
||||
final PlayerMoveData thisMove = mData.playerMoves.getCurrentMove();
|
||||
|
||||
if (pData.isDebugActive(type)) {
|
||||
debug(player, "y=" + loc.getY() + " mcfalldist=" + mcFallDistance);
|
||||
debug(player, "y=" + loc.getY() + " mcfalldist=" + mcFallDistance + " jumpphase: " + mData.sfJumpPhase + " noFallDist: " + mData.noFallFallDistance + " lowjump: " + mData.sfLowJump + " toGround: " + thisMove.to.onGround + " fromGround: " + thisMove.from.onGround);
|
||||
}
|
||||
|
||||
// Might be a violation.
|
||||
final MovingConfig mcc = pData.getGenericInstance(MovingConfig.class);
|
||||
final MovingData dataM = pData.getGenericInstance(MovingData.class);
|
||||
/*
|
||||
* TODO: NoFall data max y. (past moves too perhaps - low jump,
|
||||
* number split moves without reason)
|
||||
*/
|
||||
|
||||
// TODO: Skip near the highest jump height (needs check if head collided with something solid, which also detects low jump).
|
||||
if (!dataM.isVelocityJumpPhase() &&
|
||||
(dataM.sfLowJump && !dataM.sfNoLowJump && dataM.liftOffEnvelope == LiftOffEnvelope.NORMAL
|
||||
|| mcFallDistance < cc.criticalFallDistance && !BlockProperties.isResetCond(player, loc, mcc.yOnGround))) {
|
||||
// TODO: Use past move tracking to check for SurvivalFly and the like?
|
||||
|
||||
/*
|
||||
* Attempt to look for silent jumps by comparing the players fallDistance and the fallDistance calculated by NoFall.
|
||||
* Only check if that fall distance is below/equal to the fall disatnce set in the config.
|
||||
* Use the jumpPhase to help determine if it was a silent jump as well
|
||||
*
|
||||
* This method should reduce the false positives from the old check, by now focusing on silent jumps rather than just crit hits within a fall distance.
|
||||
*
|
||||
*/
|
||||
// 0.0009 is just a random number for leniency that works fine, maybe add a config option?
|
||||
if (Math.abs(mData.noFallFallDistance - mcFallDistance) > 0.0009 && mcFallDistance <= cc.criticalFallDistance && mData.sfJumpPhase <= 1 && !BlockProperties.isResetCond(player, loc, mcc.yOnGround) || mData.sfLowJump || mData.noFallFallDistance != mcFallDistance && thisMove.from.onGround && thisMove.to.onGround) {
|
||||
|
||||
// TODO: Use past move tracking to check for SurvivalFly and the like?
|
||||
final PlayerMoveInfo moveInfo = auxMoving.usePlayerMoveInfo();
|
||||
moveInfo.set(player, loc, null, mcc.yOnGround);
|
||||
if (MovingUtil.shouldCheckSurvivalFly(player, moveInfo.from, dataM, mcc, pData)) {
|
||||
data.criticalVL += 1.0;
|
||||
// Execute whatever actions are associated with this check and
|
||||
// the violation level and find out if we should cancel the event.
|
||||
final ViolationData vd = new ViolationData(this, player, data.criticalVL, 1.0, cc.criticalActions);
|
||||
if (vd.needsParameters()) {
|
||||
final List<String> tags = new ArrayList<String>();
|
||||
if (dataM.sfLowJump) {
|
||||
tags.add("lowjump");
|
||||
}
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
|
||||
if (MovingUtil.shouldCheckSurvivalFly(player, moveInfo.from, mData, mcc, pData)) {
|
||||
moveInfo.from.collectBlockFlags(0.4);
|
||||
|
||||
// TODO: maybe these require a fix/modification with NoFall? For now, exempt the player.
|
||||
// Don't think its possible to fake a crit in these situations either (except for being onGround in a web/water, which is checked for before being exempt) ... or at least from my testing?
|
||||
if (thisMove.from.onClimbable || thisMove.to.onClimbable) {
|
||||
|
||||
} else if ((thisMove.from.inLiquid | thisMove.to.inLiquid) && thisMove.from.onGround && thisMove.to.onGround) {
|
||||
|
||||
} else if ((thisMove.from.inWeb | thisMove.to.inWeb) & !thisMove.to.onGround) {
|
||||
|
||||
} else if ((moveInfo.from.getBlockFlags() & BlockProperties.F_BOUNCE25) != 0 && !thisMove.from.onGround && !thisMove.to.onGround) {
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
boolean exemptLowJump = false;
|
||||
// False positives with lowJump when the player jumps on/off a block while attacking an entity
|
||||
if (mData.sfLowJump) {
|
||||
|
||||
if (Math.abs(mData.noFallFallDistance - mcFallDistance) < 0.0009) {
|
||||
|
||||
if (mcFallDistance > cc.criticalFallDistance) {
|
||||
|
||||
if (!thisMove.to.onGround || !thisMove.from.onGround) {
|
||||
exemptLowJump = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (!thisMove.to.onGround || !thisMove.from.onGround) {
|
||||
|
||||
if (Math.abs(mData.noFallFallDistance - mcFallDistance) > 0.0009) {
|
||||
exemptLowJump = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!exemptLowJump) {
|
||||
data.criticalVL += 1.0;
|
||||
// Execute whatever actions are associated with this check and
|
||||
// the violation level and find out if we should cancel the event.
|
||||
final ViolationData vd = new ViolationData(this, player, data.criticalVL, 1.0, cc.criticalActions);
|
||||
if (vd.needsParameters()) {
|
||||
final List<String> tags = new ArrayList<String>();
|
||||
if (mData.sfLowJump) {
|
||||
tags.add("lowjump");
|
||||
}
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
// TODO: Introduce penalty instead of cancel.
|
||||
}
|
||||
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
// TODO: Introduce penalty instead of cancel.
|
||||
|
||||
}
|
||||
auxMoving.returnPlayerMoveInfo(moveInfo);
|
||||
auxMoving.returnPlayerMoveInfo(moveInfo);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!cancel) {
|
||||
data.criticalVL *= 0.96D;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,8 @@ public class Direction extends Check {
|
||||
|
||||
// entity.height is broken and will always be 0, therefore. Calculate height instead based on boundingBox.
|
||||
final double height = damagedIsFake ? (damaged instanceof LivingEntity ? ((LivingEntity) damaged).getEyeHeight() : 1.75) : mcAccess.getHeight(damaged);
|
||||
|
||||
final boolean isPlayer = damaged instanceof Player ? true : false;
|
||||
|
||||
// TODO: allow any hit on the y axis (might just adapt interface to use foot position + height)!
|
||||
|
||||
@@ -74,13 +76,14 @@ public class Direction extends Check {
|
||||
final Vector direction = loc.getDirection();
|
||||
|
||||
final double off;
|
||||
if (cc.directionStrict){
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION, 80.0);
|
||||
off = CollisionUtil.directionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION);
|
||||
/*if (cc.directionStrict){
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION, 80.0, isPlayer);
|
||||
}
|
||||
else{
|
||||
// Also take into account the angle.
|
||||
off = CollisionUtil.directionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION);
|
||||
}
|
||||
} */
|
||||
|
||||
if (off > 0.1) {
|
||||
// Player failed the check. Let's try to guess how far they were from looking directly to the entity...
|
||||
@@ -156,6 +159,7 @@ public class Direction extends Check {
|
||||
return false;
|
||||
}
|
||||
boolean cancel = false;
|
||||
boolean isPlayer = damaged instanceof Player ? true : false;
|
||||
|
||||
// TODO: allow any hit on the y axis (might just adapt interface to use foot position + height)!
|
||||
|
||||
@@ -165,7 +169,7 @@ public class Direction extends Check {
|
||||
final double damagedBoxMarginVertical = dLoc.getBoxMarginVertical();
|
||||
final double off;
|
||||
if (cc.directionStrict){
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), context.direction, dLoc.getX(), dLoc.getY() + damagedBoxMarginVertical / 2D, dLoc.getZ(), damagedBoxMarginHorizontal * 2.0, damagedBoxMarginVertical, TrigUtil.DIRECTION_LOOP_PRECISION, 80.0);
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), context.direction, dLoc.getX(), dLoc.getY() + damagedBoxMarginVertical / 2D, dLoc.getZ(), damagedBoxMarginHorizontal * 2.0, damagedBoxMarginVertical, cc.directionloopprecision, cc.directionangleprecision, isPlayer);
|
||||
}
|
||||
else{
|
||||
// Also take into account the angle.
|
||||
@@ -173,7 +177,7 @@ public class Direction extends Check {
|
||||
context.direction, dLoc.getX(),
|
||||
dLoc.getY() + damagedBoxMarginVertical / 2D, dLoc.getZ(),
|
||||
damagedBoxMarginHorizontal * 2.0, damagedBoxMarginVertical,
|
||||
TrigUtil.DIRECTION_LOOP_PRECISION);
|
||||
cc.directionloopprecision);
|
||||
}
|
||||
|
||||
if (off > 0.0) {
|
||||
@@ -191,7 +195,7 @@ public class Direction extends Check {
|
||||
}
|
||||
context.minResult = Math.min(context.minResult, off);
|
||||
}
|
||||
}
|
||||
} else if (cc.directionFailAll) context.minResult = 0.0;
|
||||
|
||||
return cancel;
|
||||
}
|
||||
@@ -234,4 +238,4 @@ public class Direction extends Check {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -37,17 +37,16 @@ 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;
|
||||
|
||||
public final double criticalFallDistance;
|
||||
public final ActionList criticalActions;
|
||||
|
||||
public final boolean directionStrict;
|
||||
public final boolean directionStrict;
|
||||
public final boolean directionFailAll;
|
||||
public final double directionloopprecision;
|
||||
public final double directionangleprecision;
|
||||
public final long directionPenalty;
|
||||
public final ActionList directionActions;
|
||||
|
||||
@@ -73,6 +72,7 @@ public class FightConfig extends ACheckConfig {
|
||||
public final ActionList reachActions;
|
||||
|
||||
public final ActionList selfHitActions;
|
||||
public final boolean selfHitExcludeprojectile;
|
||||
|
||||
public final int speedLimit;
|
||||
public final int speedBuckets;
|
||||
@@ -85,14 +85,12 @@ public class FightConfig extends ACheckConfig {
|
||||
public final float speedImprobableWeight;
|
||||
public final ActionList speedActions;
|
||||
|
||||
public final ActionList wrongTurnActions;
|
||||
|
||||
// Special flags:
|
||||
public final boolean cancelDead;
|
||||
public final boolean knockBackVelocityPvP;
|
||||
|
||||
/** Maximum latency counted in ticks for the loop checks (reach, direction). */
|
||||
public final long loopMaxLatencyTicks = 15; // TODO: Configurable, sections for players and entities.
|
||||
public final long loopMaxLatencyTicks; // TODO: Configurable, sections for players and entities.
|
||||
|
||||
/**
|
||||
* Instantiates a new fight configuration.
|
||||
@@ -108,10 +106,6 @@ 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);
|
||||
|
||||
@@ -119,6 +113,9 @@ public class FightConfig extends ACheckConfig {
|
||||
criticalActions = config.getOptimizedActionList(ConfPaths.FIGHT_CRITICAL_ACTIONS, Permissions.FIGHT_CRITICAL);
|
||||
|
||||
directionStrict = config.getBoolean(ConfPaths.FIGHT_DIRECTION_STRICT);
|
||||
directionFailAll = config.getBoolean(ConfPaths.FIGHT_DIRECTION_FAILALL);
|
||||
directionangleprecision = config.getDouble(ConfPaths.FIGHT_DIRECTION_STRICTANGLEPRECISION, 50.0, 100.0, 80.0);
|
||||
directionloopprecision = config.getDouble(ConfPaths.FIGHT_DIRECTION_LOOPPRECISION, 0.0, 2.0, 0.5);
|
||||
directionPenalty = config.getLong(ConfPaths.FIGHT_DIRECTION_PENALTY);
|
||||
directionActions = config.getOptimizedActionList(ConfPaths.FIGHT_DIRECTION_ACTIONS, Permissions.FIGHT_DIRECTION);
|
||||
|
||||
@@ -148,6 +145,7 @@ public class FightConfig extends ACheckConfig {
|
||||
reachActions = config.getOptimizedActionList(ConfPaths.FIGHT_REACH_ACTIONS, Permissions.FIGHT_REACH);
|
||||
|
||||
selfHitActions = config.getOptimizedActionList(ConfPaths.FIGHT_SELFHIT_ACTIONS, Permissions.FIGHT_SELFHIT);
|
||||
selfHitExcludeprojectile = config.getBoolean(ConfPaths.FIGHT_SELFHIT_EXCLUDEPROJECTILE);
|
||||
|
||||
speedLimit = config.getInt(ConfPaths.FIGHT_SPEED_LIMIT);
|
||||
speedBuckets = config.getInt(ConfPaths.FIGHT_SPEED_BUCKETS_N, 6);
|
||||
@@ -159,11 +157,8 @@ public class FightConfig extends ACheckConfig {
|
||||
speedImprobableWeight = (float) config.getDouble(ConfPaths.FIGHT_SPEED_IMPROBABLE_WEIGHT);
|
||||
speedActions = config.getOptimizedActionList(ConfPaths.FIGHT_SPEED_ACTIONS, Permissions.FIGHT_SPEED);
|
||||
|
||||
wrongTurnActions = config.getOptimizedActionList(ConfPaths.FIGHT_WRONGTURN_ACTIONS,
|
||||
CheckType.FIGHT_WRONGTURN.getPermission());
|
||||
|
||||
|
||||
cancelDead = config.getBoolean(ConfPaths.FIGHT_CANCELDEAD);
|
||||
loopMaxLatencyTicks = config.getInt(ConfPaths.FIGHT_MAXLOOPLETENCYTICKS, 1, 15, 8);
|
||||
AlmostBoolean ref = config.getAlmostBoolean(ConfPaths.FIGHT_PVP_KNOCKBACKVELOCITY, AlmostBoolean.MAYBE);
|
||||
knockBackVelocityPvP = ref == AlmostBoolean.MAYBE ? Bugs.shouldPvpKnockBackVelocity() : ref.decide();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
|
||||
// Violation levels.
|
||||
public double angleVL;
|
||||
public double clickPatternVL;
|
||||
public double criticalVL;
|
||||
public double directionVL;
|
||||
public double fastHealVL;
|
||||
@@ -43,7 +42,6 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
public double noSwingVL;
|
||||
public double reachVL;
|
||||
public double speedVL;
|
||||
public double wrongTurnVL;
|
||||
|
||||
// Shared
|
||||
public String lastWorld = "";
|
||||
@@ -96,7 +94,8 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
|
||||
// Data of the no swing check.
|
||||
public boolean noSwingArmSwung = true; // TODO: First is free for now, 1.12.2, other?
|
||||
public boolean exemptArmSwing = true;
|
||||
public boolean exemptArmSwing = false;
|
||||
public boolean noSwingPacket = false;
|
||||
|
||||
// Data of the reach check.
|
||||
public double reachMod = 1.0;
|
||||
@@ -140,8 +139,6 @@ 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());
|
||||
|
||||
@@ -90,8 +90,6 @@ 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());
|
||||
@@ -104,8 +102,6 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
|
||||
/** The no swing check. */
|
||||
private final NoSwing noSwing = addCheck(new NoSwing());
|
||||
|
||||
private final FightSync FightSync = addCheck(new FightSync());
|
||||
|
||||
/** The reach check. */
|
||||
private final Reach reach = addCheck(new Reach());
|
||||
@@ -116,9 +112,6 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
/** The speed check. */
|
||||
private final Speed speed = addCheck(new Speed());
|
||||
|
||||
/** WrongTurn: clearly invalid data on Bukkit side. */
|
||||
private final WrongTurn wrongTurn = addCheck(new WrongTurn());
|
||||
|
||||
/** For temporary use: LocUtil.clone before passing deeply, call setWorld(null) after use. */
|
||||
private final Location useLoc1 = new Location(null, 0, 0, 0);
|
||||
|
||||
@@ -319,18 +312,6 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
data.thornsId = Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
// TODO: Add as real check.
|
||||
// TODO: Add something on packet level already.
|
||||
if (pData.isCheckActive(CheckType.FIGHT_WRONGTURN, player)
|
||||
&& wrongTurn.check(player, loc, data, cc)) {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
if (speed.check(player, now, data, cc, pData)) {
|
||||
@@ -686,6 +667,14 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
if (source instanceof Player) {
|
||||
attacker = (Player) source;
|
||||
}
|
||||
}
|
||||
if (damagedPlayer != null && !damagedIsDead && (damageCause == DamageCause.BLOCK_EXPLOSION
|
||||
|| damageCause == DamageCause.ENTITY_EXPLOSION)) {
|
||||
final IPlayerData dpdata = DataManager.getPlayerData(damagedPlayer);
|
||||
if (dpdata != null) {
|
||||
MovingData data = dpdata.getGenericInstance(MovingData.class);
|
||||
data.applyexplosionvel = true;
|
||||
}
|
||||
}
|
||||
final FightData attackerData;
|
||||
final IPlayerData attackerPData = attacker == null ? null : DataManager.getPlayerData(attacker);
|
||||
@@ -781,8 +770,9 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
final MovingConfig mcc = pData.getGenericInstance(MovingConfig.class);
|
||||
// TODO: How is the direction really calculated?
|
||||
// Aim at sqrt(vx * vx + vz * vz, 2), not the exact direction.
|
||||
final double vx = level / Math.sqrt(8.0);
|
||||
final double vz = vx;
|
||||
final double[] vel2Dvec = calculateHorizontalVelocity(attacker, damagedPlayer);
|
||||
final double vx = vel2Dvec[0];
|
||||
final double vz = vel2Dvec[1];
|
||||
final double vy = 0.462; // TODO: (0.365) Needs other workarounds, to allow more when moving off ground (vel + GRAVITY_MAX or max jump gain + little?).
|
||||
useLoc1.setWorld(null); // Cleanup.
|
||||
if (pData.isDebugActive(checkType) || pData.isDebugActive(CheckType.MOVING)) {
|
||||
@@ -814,6 +804,54 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
// Cap the level to something reasonable. TODO: Config / cap the velocity anyway.
|
||||
return Math.min(20.0, level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Better method to calculate horizontal velocity including direction!
|
||||
*
|
||||
* @param attacker
|
||||
* @param damagedPlayer
|
||||
* @return velocityX, velocityZ
|
||||
*/
|
||||
private double[] calculateHorizontalVelocity(final Player attacker, final Player damagedPlayer) {
|
||||
final Location aloc = attacker.getLocation();
|
||||
final Location dloc = damagedPlayer.getLocation();
|
||||
final double Xdiff = dloc.getX() - aloc.getX();
|
||||
final double Zdiff = dloc.getZ() - aloc.getZ();
|
||||
final double diffdist = Math.sqrt(Xdiff * Xdiff + Zdiff * Zdiff);
|
||||
double vx = 0.0;
|
||||
double vz = 0.0;
|
||||
int incknockbacklevel = 0;
|
||||
// TODO: Get the RELEVANT item (...).
|
||||
final ItemStack stack = Bridge1_9.getItemInMainHand(attacker);
|
||||
if (!BlockProperties.isAir(stack)) {
|
||||
incknockbacklevel = stack.getEnchantmentLevel(Enchantment.KNOCKBACK);
|
||||
}
|
||||
if (attacker.isSprinting()) {
|
||||
// TODO: Lost sprint?
|
||||
incknockbacklevel++;
|
||||
}
|
||||
// Cap the level to something reasonable. TODO: Config / cap the velocity anyway.
|
||||
incknockbacklevel = Math.min(20, incknockbacklevel);
|
||||
|
||||
if (Math.sqrt(Xdiff * Xdiff + Zdiff * Zdiff) < 1.0E-4D) {
|
||||
if (incknockbacklevel <= 0) incknockbacklevel = -~0;
|
||||
vx = vz = incknockbacklevel / Math.sqrt(8.0);
|
||||
return new double[] {vx, vz};
|
||||
} else {
|
||||
vx = Xdiff / diffdist * 0.4;
|
||||
vz = Zdiff / diffdist * 0.4;
|
||||
}
|
||||
|
||||
if (incknockbacklevel > 0) {
|
||||
vx *= 1.0 + 1.25 * incknockbacklevel;
|
||||
vz *= 1.0 + 1.25 * incknockbacklevel;
|
||||
// Still not exact direction since yaw difference between packet and Location#getYaw();
|
||||
// with incknockbacklevel = 0, it still the precise direction
|
||||
//vx -= Math.sin(aloc.getYaw() * Math.PI / 180.0F) * incknockbacklevel * 0.5F;
|
||||
//vz += Math.cos(aloc.getYaw() * Math.PI / 180.0F) * incknockbacklevel * 0.5F;
|
||||
}
|
||||
return new double[] {vx, vz};
|
||||
}
|
||||
|
||||
/**
|
||||
* We listen to death events to prevent a very specific method of doing godmode.
|
||||
@@ -846,8 +884,9 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
* TODO: First one always fails: Packet inversion on 1.12.2? This could
|
||||
* be moved to packet level (register either).
|
||||
*/
|
||||
DataManager.getGenericInstance(event.getPlayer(),
|
||||
FightData.class).noSwingArmSwung = true;
|
||||
final FightData data = DataManager.getGenericInstance(event.getPlayer(), FightData.class);
|
||||
if (data.noSwingPacket) return;
|
||||
data.noSwingArmSwung = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -900,11 +939,7 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
final Player player = e.getPlayer();
|
||||
final FightData data = DataManager.getGenericInstance(player, FightData.class);
|
||||
|
||||
if (entity != null && entity.getType().name().equals("PARROT")) {
|
||||
data.exemptArmSwing = true;
|
||||
} else {
|
||||
data.exemptArmSwing = false;
|
||||
}
|
||||
data.exemptArmSwing = entity != null && entity.getType().name().equals("PARROT") ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -926,29 +961,5 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
pData.getGenericInstance(FightData.class).attackPenalty.applyPenalty(penalty);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void entityDamage(EntityDamageByEntityEvent event) {
|
||||
if (!(event.getDamager() instanceof Player)) return;
|
||||
Player player = (Player) event.getDamager();
|
||||
|
||||
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.fightSyncReset += 1;
|
||||
Location packet = data.lastHitLocation, eventLoc = player.getLocation();
|
||||
|
||||
if (FightSync.check(player, pData, data, packet, eventLoc, cc)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package fr.neatmonster.nocheatplus.checks.fight;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
|
||||
public class FightSync extends Check {
|
||||
|
||||
public FightSync() {
|
||||
super(CheckType.NET_FIGHTSYNC);
|
||||
}
|
||||
|
||||
public boolean check(Player player, IPlayerData pData, NetData data, Location packet, Location eventLoc, final NetConfig cc) {
|
||||
boolean cancel = false;
|
||||
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) {
|
||||
data.fightSyncVL += diff * 5;
|
||||
cancel = executeActions(player, data.fightSyncVL, Math.abs(diff * 5), pData.getGenericInstance(NetConfig.class).fightSyncActions).willCancel();
|
||||
data.fightSyncCount = 0;
|
||||
} else {
|
||||
data.fightSyncCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.fight;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
|
||||
/**
|
||||
* First WrongTurn variant (pitch, possibly other).
|
||||
*
|
||||
* @author asofold
|
||||
*
|
||||
*/
|
||||
public class WrongTurn extends Check {
|
||||
|
||||
public WrongTurn() {
|
||||
super(CheckType.FIGHT_WRONGTURN);
|
||||
}
|
||||
|
||||
public boolean check (final Player player, final Location loc,
|
||||
final FightData data, final FightConfig cc) {
|
||||
|
||||
final float pitch = loc.getPitch();
|
||||
|
||||
// Invalid Pitch
|
||||
// TODO: Does invalid pitch arrive here at all?
|
||||
// TODO: Prefer to detect on packet level already.
|
||||
if (Math.abs(pitch) > 90.0f || pitch < -90.0f) {
|
||||
data.wrongTurnVL += 1; // (Never cooldown.)
|
||||
if (executeActions(player, data.wrongTurnVL, 1.0, cc.wrongTurnActions).willCancel()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Better have the following in a check not resulting in banning 100% of the time.
|
||||
// TODO: Suspicious yaw + pitch combination (static).
|
||||
/*
|
||||
* TODO: Past moves: detect fast turning towards opponent for an easier
|
||||
* thing (re-use for difficulty). Better have an extra spot for relating
|
||||
* moves of the attacker vs. moves of the attacked.
|
||||
*/
|
||||
// TODO: Past moves: detect optimizing look/position in general.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -24,6 +24,7 @@ import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.net.FlyingQueueHandle;
|
||||
import fr.neatmonster.nocheatplus.checks.net.FlyingQueueLookBlockChecker;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.components.config.ICheckConfig;
|
||||
import fr.neatmonster.nocheatplus.components.data.ICheckData;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
@@ -198,7 +199,7 @@ public abstract class AbstractBlockDirectionCheck<D extends ICheckData, C extend
|
||||
// Initialize fully each time.
|
||||
boulder.setFindNearestPointIfNotCollide(true)
|
||||
.setRay(x, y, z, dirX, dirY, dirZ)
|
||||
.setAABB(blockX, blockY, blockZ, 0.1)
|
||||
.setAABB(blockX, blockY, blockZ, Bridge1_13.hasIsSwimming() ? 0.9 : 0.1)
|
||||
.loop();
|
||||
// Interpret result.
|
||||
if (boulder.collides()) {
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class InventoryConfig extends ACheckConfig {
|
||||
openCancelOther = data.getBoolean(ConfPaths.INVENTORY_OPEN_CANCELOTHER);
|
||||
|
||||
invMoveDisableCreative = data.getBoolean(ConfPaths.INVENTORY_INVENTORYMOVE_DISABLECREATIVE);
|
||||
invMoveActionList = data.getOptimizedActionList(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, Permissions.INVENTORY_MOVE);
|
||||
invMoveActionList = data.getOptimizedActionList(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, Permissions.INVENTORY_INVENTORYMOVE);
|
||||
|
||||
hotFixFallingBlockEndPortalActive = data.getBoolean(ConfPaths.INVENTORY_HOTFIX_DUPE_FALLINGBLOCKENDPORTAL);
|
||||
}
|
||||
|
||||
+29
@@ -41,6 +41,7 @@ import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerPortalEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@@ -53,6 +54,7 @@ import fr.neatmonster.nocheatplus.checks.CheckListener;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.Combined;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.Improbable;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||
@@ -84,6 +86,9 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
|
||||
/** Inventory Move check */
|
||||
private final InventoryMove invMove = addCheck(new InventoryMove());
|
||||
|
||||
/** More Inventory check */
|
||||
private final MoreInventory moreInv = addCheck(new MoreInventory());
|
||||
|
||||
/** The fast click check. */
|
||||
private final FastClick fastClick = addCheck(new FastClick());
|
||||
@@ -576,6 +581,30 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onMove(final PlayerMoveEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final Location from = event.getFrom();
|
||||
final Location to = event.getTo();
|
||||
final boolean PoYdiff = from.getPitch() != to.getPitch() || from.getYaw() != to.getYaw();
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (pData == null) return;
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
final Inventory inv = player.getOpenInventory().getTopInventory();
|
||||
if (moreInv.isEnabled(player, pData)
|
||||
&& moreInv.check(player, data, pData, inv.getType(), inv, PoYdiff)) {
|
||||
for (int i =1; i<=4 ;i++) {
|
||||
final ItemStack item = inv.getItem(i);
|
||||
if (item != null && item.getType() != Material.AIR) {
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), item);
|
||||
inv.setItem(i, null);
|
||||
if (pData.isDebugActive(CheckType.INVENTORY_MOREINVENTORY))
|
||||
debug(player , "Drop items from crafting slot:" + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerTeleport(final PlayerTeleportEvent event) {
|
||||
|
||||
+15
-4
@@ -4,6 +4,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.inventory.InventoryType.SlotType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -12,6 +13,8 @@ import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
@@ -25,13 +28,20 @@ public class InventoryMove extends Check {
|
||||
private final List<String> tags = new LinkedList<String>();
|
||||
|
||||
public InventoryMove() {
|
||||
super(CheckType.INVENTORY_MOVE);
|
||||
super(CheckType.INVENTORY_INVENTORYMOVE);
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final InventoryData data, final IPlayerData pData, final InventoryConfig cc, final SlotType type) {
|
||||
|
||||
boolean cancel = false;
|
||||
|
||||
final MovingData Mdata = pData.getGenericInstance(MovingData.class);
|
||||
final PlayerMoveData lastMove = Mdata.playerMoves.getCurrentMove();
|
||||
final boolean isOnGround = lastMove.touchedGround || lastMove.from.onGround || lastMove.to.onGround;
|
||||
|
||||
// Dummy way to fix bug when interacting shopkeeper trader
|
||||
final boolean a = player.getOpenInventory().getTopInventory().getType() == InventoryType.MERCHANT;
|
||||
|
||||
// Tags
|
||||
if (player.isBlocking()) {
|
||||
tags.add("isBlocking");
|
||||
@@ -39,8 +49,8 @@ public class InventoryMove extends Check {
|
||||
else if (player.isSneaking()) {
|
||||
tags.add("isSneaking");
|
||||
}
|
||||
else if (Bridge1_13.isSwimming(player)) {
|
||||
tags.add("isSwimming");
|
||||
else if (Bridge1_13.isSwimming(player)) {
|
||||
if (!isOnGround) tags.add("isSwimming");
|
||||
}
|
||||
else if (player.isSprinting()) {
|
||||
tags.add("isSprinting");
|
||||
@@ -50,7 +60,8 @@ public class InventoryMove extends Check {
|
||||
}
|
||||
|
||||
// Do the actual check
|
||||
if (player.isSneaking() || player.isSprinting() || Bridge1_13.isSwimming(player) || player.isBlocking() || player.isDead()) {
|
||||
if (player.isSneaking() || (player.isSprinting() && !Bridge1_13.isSwimming(player))
|
||||
|| (player.isBlocking() && !a) || player.isDead() || (Bridge1_13.isSwimming(player) && !isOnGround)) {
|
||||
// Check if the player is in creative
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
// (Skip hotbar interactions)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package fr.neatmonster.nocheatplus.checks.inventory;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
|
||||
public class MoreInventory extends Check{
|
||||
public MoreInventory() {
|
||||
super(CheckType.INVENTORY_MOREINVENTORY);
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final MovingData movingdata, final IPlayerData pData, final InventoryType type, final Inventory inv, final boolean PoYdiff) {
|
||||
if (type == InventoryType.CRAFTING
|
||||
&& (player.isSprinting() || PoYdiff || player.isBlocking() || player.isSneaking() || movingdata.isusingitem)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -169,6 +169,8 @@ public class MovingConfig extends ACheckConfig {
|
||||
public final boolean enforceLocation;
|
||||
public final boolean trackBlockMove;
|
||||
public final PlayerSetBackMethod playerSetBackMethod;
|
||||
public final boolean resetFwOnground;
|
||||
public final boolean elytraStrict;
|
||||
|
||||
// Vehicles
|
||||
public final boolean vehicleEnforceLocation;
|
||||
@@ -218,6 +220,8 @@ public class MovingConfig extends ACheckConfig {
|
||||
flyingModelElytra = new ModelFlying(ID_JETPACK_ELYTRA, config,
|
||||
ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra.",
|
||||
new ModelFlying(null, defaultModel).verticalAscendGliding(true).lock());
|
||||
resetFwOnground = config.getBoolean(ConfPaths.MOVING_CREATIVEFLY_EYTRA_FWRESET);
|
||||
elytraStrict = config.getBoolean(ConfPaths.MOVING_CREATIVEFLY_EYTRA_STRICT);
|
||||
creativeFlyActions = config.getOptimizedActionList(ConfPaths.MOVING_CREATIVEFLY_ACTIONS,
|
||||
Permissions.MOVING_CREATIVEFLY);
|
||||
|
||||
@@ -404,4 +408,4 @@ public class MovingConfig extends ACheckConfig {
|
||||
return modelGameMode;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,11 @@ public class MovingData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
public int liqtick = 0;
|
||||
public int watermovect = 0;
|
||||
public int bunnyhopDelay;
|
||||
public int lastbunnyhopDelay = 0;
|
||||
public int bunnyhopTick = 0;
|
||||
public double jumpAmplifier = 0;
|
||||
public long delayWorkaround = 0;
|
||||
public boolean applyexplosionvel = false;
|
||||
/** Last time the player was actually sprinting. */
|
||||
public long timeSprinting = 0;
|
||||
public long bedLeaveTime = 0;
|
||||
@@ -120,6 +124,7 @@ public class MovingData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
public boolean isusingitem = false;
|
||||
public long time_rl_item = 0;
|
||||
public boolean isHackingRI = false;
|
||||
public int noslowhop = 0;
|
||||
|
||||
/** Count set back (re-) setting. */
|
||||
private int playerMoveCount = 0;
|
||||
@@ -168,6 +173,7 @@ public class MovingData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
|
||||
/** Duration of the boost effect in ticks. */
|
||||
public int fireworksBoostDuration = 0;
|
||||
public int fireworksBoostTickNeedCheck = 0;
|
||||
/**
|
||||
* Expire at this tick.
|
||||
*/
|
||||
@@ -1382,4 +1388,4 @@ public class MovingData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+89
-31
@@ -69,6 +69,7 @@ import fr.neatmonster.nocheatplus.checks.combined.Combined;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.CombinedConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.CombinedData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.magic.Magic;
|
||||
import fr.neatmonster.nocheatplus.checks.fight.FightConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.ModelFlying;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveInfo;
|
||||
@@ -380,7 +381,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
}
|
||||
final Material m = other.getLocation().getBlock().getType();
|
||||
final double locY = other.getLocation().getY();
|
||||
if (Math.abs(locY - minY) < 0.7 && (BlockProperties.isLiquid(m) || BlockProperties.isNewLiq(m))){
|
||||
if (Math.abs(locY - minY) < 0.7 && BlockProperties.isLiquid(m)){
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
@@ -463,15 +464,19 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
* Early return / adapt, if necessary.
|
||||
*/
|
||||
|
||||
final Location from = event.getFrom();
|
||||
final Location to = event.getTo();
|
||||
final Location from = event.getFrom().clone();
|
||||
final Location to = event.getTo().clone();
|
||||
Location newTo = null;
|
||||
|
||||
// // Check problematic yaw/pitch values.
|
||||
// if (LocUtil.needsDirectionCorrection(from.getYaw(), from.getPitch())
|
||||
// || LocUtil.needsDirectionCorrection(to.getYaw(), to.getPitch())) {
|
||||
// DataManager.getPlayerData(player).task.correctDirection();
|
||||
// }
|
||||
// Check problematic yaw/pitch values.
|
||||
if (LocUtil.needsDirectionCorrection2(from.getYaw(), from.getPitch())) {
|
||||
from.setYaw(LocUtil.correctYaw2(from.getYaw()));
|
||||
from.setPitch(LocUtil.correctPitch(from.getPitch()));
|
||||
}
|
||||
if (LocUtil.needsDirectionCorrection2(to.getYaw(), to.getPitch())) {
|
||||
to.setYaw(LocUtil.correctYaw2(to.getYaw()));
|
||||
to.setPitch(LocUtil.correctPitch(to.getPitch()));
|
||||
}
|
||||
|
||||
// TODO: Check illegal moves here anyway (!).
|
||||
// TODO: Check if vehicle move logs correctly (fake).
|
||||
@@ -758,7 +763,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
checkSf = true;
|
||||
data.adjustWalkSpeed(player.getWalkSpeed(), tick, cc.speedGrace);
|
||||
}
|
||||
else if (pData.isDebugActive(CheckType.MOVING_CREATIVEFLY)) {
|
||||
else if (pData.isCheckActive(CheckType.MOVING_CREATIVEFLY, player)) {
|
||||
checkCf = true;
|
||||
checkSf = false;
|
||||
prepareCreativeFlyCheck(player, from, to, moveInfo, thisMove, multiMoveCount, tick, data, cc);
|
||||
@@ -767,6 +772,8 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
checkCf = true;
|
||||
checkSf = false;
|
||||
prepareCreativeFlyCheck(player, from, to, moveInfo, thisMove, multiMoveCount, tick, data, cc);
|
||||
checkCf = checkSf = false;
|
||||
// (thisMove.flyCheck stays null.)
|
||||
}
|
||||
|
||||
// Pre-check checks (hum), either for cf or for sf.
|
||||
@@ -788,6 +795,18 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
}
|
||||
}
|
||||
|
||||
// Proactive reset of elytraBoost (MC 1.11.2).
|
||||
if (data.fireworksBoostDuration > 0) {
|
||||
if (!lastMove.valid
|
||||
|| (cc.resetFwOnground && (lastMove.flyCheck != CheckType.MOVING_CREATIVEFLY || lastMove.modelFlying != thisMove.modelFlying))
|
||||
|| data.fireworksBoostTickExpire < tick) {
|
||||
data.fireworksBoostDuration = 0;
|
||||
}
|
||||
else {
|
||||
data.fireworksBoostDuration --;
|
||||
}
|
||||
}
|
||||
|
||||
if (pFrom.isInLiquid()) {
|
||||
data.liqtick = data.liqtick < 50 ? data.liqtick + 1 : data.liqtick > 0 ? data.liqtick - 1 : 0;
|
||||
} else data.liqtick = data.liqtick > 0 ? data.liqtick - 2 : 0;
|
||||
@@ -844,7 +863,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
&& checkBounceEnvelope(player, pFrom, pTo, data, cc, pData)) {
|
||||
// TODO: Check other side conditions (fluids, web, max. distance to the block top (!))
|
||||
// Classic static bounce.
|
||||
if ((BlockProperties.getBlockFlags(pTo.getTypeIdBelow())
|
||||
if ((pTo.getBlockFlags()
|
||||
& BlockProperties.F_BOUNCE25) != 0L) {
|
||||
/*
|
||||
* TODO: May need to adapt within this method, if
|
||||
@@ -914,7 +933,16 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
|
||||
// Hack: Add velocity for transitions between creativefly and survivalfly.
|
||||
if (lastMove.toIsValid && lastMove.flyCheck == CheckType.MOVING_CREATIVEFLY) {
|
||||
workaroundFlyNoFlyTransition(player, tick, debug, data);
|
||||
final long tickhaslag = data.delayWorkaround + Math.round(200 / TickTask.getLag(200, true));
|
||||
if (data.delayWorkaround > time || tickhaslag < time) {
|
||||
workaroundFlyNoFlyTransition(player, tick, debug, data);
|
||||
data.delayWorkaround = time;
|
||||
}
|
||||
}
|
||||
if (thisMove.toIsValid && data.applyexplosionvel && thisMove.yDistance < 3.0 && thisMove.yDistance > -3.0) {
|
||||
data.applyexplosionvel = false;
|
||||
data.addVerticalVelocity(new SimpleEntry(thisMove.yDistance, 1));
|
||||
data.setFrictionJumpPhase();
|
||||
}
|
||||
|
||||
// Actual check.
|
||||
@@ -972,6 +1000,10 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
thisMove.flyCheck = CheckType.MOVING_CREATIVEFLY;
|
||||
newTo = creativeFly.check(player, pFrom, pTo,
|
||||
data, cc, pData, time, tick, useBlockChangeTracker);
|
||||
// NoFall.
|
||||
if (checkNf) {
|
||||
noFall.check(player, pFrom, pTo, previousSetBackY, data, cc, pData);
|
||||
}
|
||||
}
|
||||
data.sfHoverTicks = -1;
|
||||
data.sfLowJump = false;
|
||||
@@ -1257,17 +1289,24 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
*/
|
||||
private boolean checkBounceEnvelope(final Player player, final PlayerLocation from, final PlayerLocation to,
|
||||
final MovingData data, final MovingConfig cc, final IPlayerData pData) {
|
||||
|
||||
// Workaround/fix for bed bouncing. getBlockY() would return an int, while a bed's maxY is 0.5625, causing this method to always return false.
|
||||
// A better way to do this would to get the maxY through another method, just can't seem to find it :/
|
||||
// Collect block flags at the current location as they may not already be there, and cause NullPointer errors.
|
||||
to.collectBlockFlags();
|
||||
double blockY = ((to.getBlockFlags() & BlockProperties.F_BOUNCE25) != 0) && ((to.getY() + 0.4375) % 1 == 0) ? to.getY() : to.getBlockY();
|
||||
|
||||
return
|
||||
// 0: Normal envelope (forestall NoFall).
|
||||
(
|
||||
// 1: Ordinary.
|
||||
to.getY() - to.getBlockY() <= Math.max(cc.yOnGround, cc.noFallyOnGround)
|
||||
to.getY() - blockY <= Math.max(cc.yOnGround, cc.noFallyOnGround)
|
||||
// 1: With carpet.
|
||||
|| BlockProperties.isCarpet(to.getTypeId()) && to.getY() - to.getBlockY() <= 0.9
|
||||
)
|
||||
&& MovingUtil.getRealisticFallDistance(player, from.getY(), to.getY(), data, pData) > 1.0
|
||||
// 0: Within wobble-distance.
|
||||
|| to.getY() - to.getBlockY() < 0.286 && to.getY() - from.getY() > -0.5
|
||||
|| to.getY() - blockY < 0.286 && to.getY() - from.getY() > -0.5
|
||||
&& to.getY() - from.getY() < -Magic.GRAVITY_MIN
|
||||
&& !to.isOnGround()
|
||||
;
|
||||
@@ -1371,6 +1410,10 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
final Check check;
|
||||
final ActionList actions;
|
||||
final double vL;
|
||||
long now = System.currentTimeMillis();
|
||||
if ((Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && TrigUtil.distance(from, to)< 20) {
|
||||
return null;
|
||||
}
|
||||
if (thisMove.flyCheck == CheckType.MOVING_SURVIVALFLY) {
|
||||
check = survivalFly;
|
||||
actions = cc.survivalFlyActions;
|
||||
@@ -1391,10 +1434,6 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
vd.setParameter(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", TrigUtil.distance(from, to)));
|
||||
vd.setParameter(ParameterName.TAGS, "EXTREME_MOVE");
|
||||
}
|
||||
long now = System.currentTimeMillis();
|
||||
if ((Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now ) && TrigUtil.distance(from, to)< (Bridge1_9.isGliding(player) ? 10.0 : 7.5)) {
|
||||
return null;
|
||||
}
|
||||
// Some resetting is done in MovingListener.
|
||||
if (check.executeActions(vd).willCancel()) {
|
||||
// Set back + view direction of to (more smooth).
|
||||
@@ -1421,12 +1460,11 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
data.clearActiveHorVel(); // Clear active velocity due to adding actual speed here.
|
||||
data.addHorizontalVelocity(new AccountEntry(tick, amount, 1, MovingData.getHorVelValCount(amount)));
|
||||
data.addVerticalVelocity(new SimpleEntry(lastMove.yDistance, 2));
|
||||
// 1.15 elytra fly-nofly workaround, need to use velocity above twice
|
||||
data.addVerticalVelocity(new SimpleEntry(lastMove.yDistance, 2));
|
||||
data.addVerticalVelocity(new SimpleEntry(0.34, 3));
|
||||
data.addVerticalVelocity(new SimpleEntry(0.0, 2));
|
||||
data.setFrictionJumpPhase();
|
||||
// Reset fall height.
|
||||
// TODO: Later (e.g. 1.9) check for the ModelFlying, if fall damage is intended.
|
||||
data.clearNoFallData();
|
||||
player.setFallDistance(0f); // TODO: Might do without this in case of elytra, needs ensure NoFall doesn't kill the player (...).
|
||||
if (debug) {
|
||||
debug(player, "Fly-nofly transition: Add velocity.");
|
||||
}
|
||||
@@ -1437,7 +1475,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
// Default margin: Allow slightly less than the previous speed.
|
||||
final double defaultAmount = lastMove.hDistance * (1.0 + Magic.FRICTION_MEDIUM_AIR) / 2.0;
|
||||
// Test for exceptions.
|
||||
if (thisMove.hDistance > defaultAmount && Bridge1_9.isGlidingWithElytra(player)) {
|
||||
if (thisMove.hDistance > defaultAmount && Bridge1_9.isWearingElytra(player) && lastMove.modelFlying.getId().equals(MovingConfig.ID_JETPACK_ELYTRA)) {
|
||||
// Allowing the same speed won't always work on elytra (still increasing, differing modeling on client side with motXYZ).
|
||||
// (Doesn't seem to be overly effective.)
|
||||
final PlayerMoveData secondPastMove = data.playerMoves.getSecondPastMove();
|
||||
@@ -1760,6 +1798,8 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
//final MovingConfig cc = pData.getGenericInstance(MovingConfig.class);
|
||||
data.clearMostMovingCheckData();
|
||||
data.setSetBack(player.getLocation(useLoc)); // TODO: Monitor this change (!).
|
||||
data.isusingitem = false;
|
||||
|
||||
if (pData.isDebugActive(checkType)) {
|
||||
// Log location.
|
||||
debug(player, "Death: " + player.getLocation(useLoc));
|
||||
@@ -2204,12 +2244,12 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
|
||||
public void onSelfDamage(final EntityDamageByEntityEvent event) {
|
||||
final Entity entity = event.getEntity();
|
||||
if (!(entity instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
if (!(entity instanceof Player)) return;
|
||||
|
||||
checkSelfHit((Player) entity, event);
|
||||
}
|
||||
|
||||
// TODO: Move to fight listener
|
||||
private void checkSelfHit(final Player player, final EntityDamageByEntityEvent event) {
|
||||
Entity entity = event.getDamager();
|
||||
if(entity instanceof Projectile)
|
||||
@@ -2221,8 +2261,9 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
if (p == player) {
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
final FightConfig fconfig = pData.getGenericInstance(FightConfig.class);
|
||||
final long now = System.currentTimeMillis();
|
||||
if (!pData.hasPermission(Permissions.FIGHT_SELFHIT, player) && data.selfhittime != 0 && data.selfhittime + 1100 > now) {
|
||||
if (!fconfig.selfHitExcludeprojectile && !pData.hasPermission(Permissions.FIGHT_SELFHIT, player) && data.selfhittime != 0 && data.selfhittime + 1100 > now) {
|
||||
// TODO: This feature must be configurable
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(ChatColor.DARK_RED + "Self-velocity is not allowed!");
|
||||
@@ -2359,9 +2400,10 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
: NoFall.getDamage(Math.max(yDiff, Math.max(data.noFallFallDistance, fallDistance))) + (allowReset ? 0.0 : Magic.FALL_DAMAGE_DIST);
|
||||
if (maxD > damage) {
|
||||
// TODO: respect dealDamage ?
|
||||
BridgeHealth.setRawDamage(event, maxD);
|
||||
double damageafter = NoFall.calcDamagewithfeatherfalling(player, NoFall.calcReducedDamageByHB(player, maxD));
|
||||
BridgeHealth.setRawDamage(event, damageafter);
|
||||
if (debug) {
|
||||
debug(player, "Adjust fall damage to: " + maxD);
|
||||
debug(player, "Adjust fall damage to: " + (damageafter != maxD ? damageafter : maxD));
|
||||
}
|
||||
}
|
||||
if (allowReset) {
|
||||
@@ -2569,8 +2611,24 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
// TODO: Consider to catch all, at least (debug-) logging-wise.
|
||||
if (!BlockProperties.isPassable(loc)) {
|
||||
final PlayerMoveData lastMove = data.playerMoves.getFirstPastMove();
|
||||
if (lastMove.toIsValid) {
|
||||
final Location refLoc = new Location(loc.getWorld(), lastMove.to.getX(), lastMove.to.getY(), lastMove.to.getZ());
|
||||
final PlayerMoveData lastMove2 = data.playerMoves.getNumberOfPastMoves() > 1 ? data.playerMoves.getSecondPastMove() : null;
|
||||
// Won't use lastMove.toIsValid to prevent players already failed some checks in last move
|
||||
if (lastMove.valid) {
|
||||
Location refLoc = lastMove.toIsValid ? new Location(loc.getWorld(), lastMove.to.getX(), lastMove.to.getY(), lastMove.to.getZ()) :
|
||||
new Location(loc.getWorld(), lastMove.from.getX(), lastMove.from.getY(), lastMove.from.getZ());
|
||||
// More likely lastmove location is same with left location, try to check for second lastmove
|
||||
if (TrigUtil.isSamePos(loc, refLoc) && !lastMove.toIsValid && lastMove2 != null) {
|
||||
refLoc = lastMove2.toIsValid ? new Location(loc.getWorld(), lastMove2.to.getX(), lastMove2.to.getY(), lastMove2.to.getZ()) :
|
||||
new Location(loc.getWorld(), lastMove2.from.getX(), lastMove2.from.getY(), lastMove2.from.getZ());
|
||||
}
|
||||
// Correct position by scan block up
|
||||
// TODO: what about try to phase upward not downward anymore?
|
||||
if (!BlockProperties.isPassable(refLoc) || refLoc.distanceSquared(loc) > 1.25) {
|
||||
double y = Math.ceil(loc.getY());
|
||||
refLoc = loc.clone();
|
||||
refLoc.setY(y);
|
||||
if (!BlockProperties.isPassable(refLoc)) refLoc = loc;
|
||||
}
|
||||
final double d = refLoc.distanceSquared(loc);
|
||||
if (d > 0.0) {
|
||||
// TODO: Consider to always set back here. Might skip on big distances.
|
||||
@@ -2952,4 +3010,4 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -130,8 +130,8 @@ public class LocationTrace {
|
||||
@Override
|
||||
public boolean isInside(final double x, final double y, final double z) {
|
||||
return y >= this.y && y <= this.y + this.boxMarginVertical
|
||||
&& Math.abs(x - this.x) <= this.boxMarginHorizontal
|
||||
&& Math.abs(z - this.z) <= this.boxMarginHorizontal;
|
||||
&& Math.abs(x - this.x) <= this.boxMarginHorizontal * 2.5
|
||||
&& Math.abs(z - this.z) <= this.boxMarginHorizontal * 2.5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,28 +47,28 @@ public class Magic {
|
||||
// Horizontal speeds/modifiers.
|
||||
public static final double WALK_SPEED = 0.221D;
|
||||
public static final double modSneak = 0.13D / WALK_SPEED;
|
||||
// public static final double modSprint = 0.29 / walkSpeed; // TODO: without bunny 0.29 / practical is 0.35
|
||||
public static final double modSprint = 0.27 / WALK_SPEED; // TODO: without bunny 0.29 / practical is 0.35
|
||||
public static final double modBlock = 0.1277D / WALK_SPEED;
|
||||
public static final double[] modSwim = new double[] {0.155D / WALK_SPEED, 0.3D / WALK_SPEED, 0.115D / WALK_SPEED}; // 0.155D / WALK_SPEED(1.13 above); 0.115D / WALK_SPEED(1.12.2 below)
|
||||
public static final double[] modSwim = new double[] {0.115D / WALK_SPEED, 0.044D / WALK_SPEED, 0.3D / WALK_SPEED}; // 0.044D for horizontal, 0.3 for vertical swimming
|
||||
public static final double[] modRiptide = new double[] {
|
||||
1.0,
|
||||
4.8, //4.6 ?
|
||||
7.2, //7.0 ?
|
||||
10.0
|
||||
};
|
||||
public static final double modDolphinsGrace = 3.6D; // 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 modDolphinsGrace = 4.3D; // TODO: Adjust value to be more stricter and closer to actual movement speed, and use different value from in water vs above water
|
||||
public static final double[] modDepthStrider = new double[] {
|
||||
1.0,
|
||||
0.1645 / modSwim[0] / WALK_SPEED,
|
||||
0.1995 / modSwim[0] / WALK_SPEED,
|
||||
1.0 / modSwim[0], // Results in walkspeed.
|
||||
};
|
||||
public static final double modWeb = 0.105D / WALK_SPEED; // TODO: walkingSpeed * 0.15D; <- does not work
|
||||
public static final double modWeb = 0.09D / WALK_SPEED; // TODO: walkingSpeed * 0.15D; <- does not work
|
||||
public static final double modSoulSand = 0.16D / WALK_SPEED;
|
||||
public static final double modStairs = 0.27D / WALK_SPEED;
|
||||
public static final double modIce = 2.5D; //
|
||||
/** Faster moving down stream (water mainly). */
|
||||
public static final double modDownStream = 0.19 / (WALK_SPEED * modSwim[0]);
|
||||
public static final double modDownStream2 = 0.19 / (WALK_SPEED * modSwim[1]);
|
||||
|
||||
/**
|
||||
* Somewhat arbitrary horizontal speed gain maximum for advance glide phase.
|
||||
@@ -133,7 +133,7 @@ public class Magic {
|
||||
*/
|
||||
public static double swimBaseSpeedV(boolean isSwimming) {
|
||||
// TODO: Does this have to be the dynamic walk speed (refactoring)?
|
||||
return isSwimming ? WALK_SPEED * modSwim[1] + 0.1 : WALK_SPEED * modSwim[0] + 0.1; // 0.244
|
||||
return isSwimming ? WALK_SPEED * modSwim[2] + 0.1 : WALK_SPEED * modSwim[0] + 0.07; // 0.244
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -385,4 +385,4 @@ public class Magic {
|
||||
&& lastMove.yDistance < maxJumpGain && lastMove.yDistance > maxJumpGain * 0.67
|
||||
&& Magic.fallingEnvelope(yDistance, maxJumpGain, data.lastFrictionVertical, Magic.GRAVITY_SPAN);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@ import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.SimpleEntry;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.VelocityFlags;
|
||||
import fr.neatmonster.nocheatplus.checks.workaround.WRPT;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
@@ -69,6 +71,22 @@ public class MagicAir {
|
||||
&& data.ws.use(WRPT.W_M_SF_SLIME_JP_2X0)
|
||||
;
|
||||
}
|
||||
|
||||
public static boolean oddBounce(final PlayerLocation to, final double yDistance, final PlayerMoveData lastMove, final MovingData data) {
|
||||
final SimpleEntry entry = data.peekVerticalVelocity(yDistance, 0, 4);
|
||||
if (entry != null && entry.hasFlag(VelocityFlags.ORIGIN_BLOCK_BOUNCE)) {
|
||||
data.setFrictionJumpPhase();
|
||||
return true;
|
||||
} else {
|
||||
// Try to use past yDis
|
||||
final SimpleEntry entry2 = data.peekVerticalVelocity(lastMove.yDistance, 0, 4);
|
||||
if (entry2 != null && entry2.hasFlag(VelocityFlags.ORIGIN_BLOCK_BOUNCE)) {
|
||||
data.setFrictionJumpPhase();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Odd decrease after lift-off.
|
||||
@@ -184,6 +202,7 @@ public class MagicAir {
|
||||
// yDistance >= -GRAVITY_MAX - GRAVITY_SPAN
|
||||
// && (yDistChange < -GRAVITY_MIN && Math.abs(yDistChange) <= 2.0 * GRAVITY_MAX + GRAVITY_SPAN
|
||||
// || from.isHeadObstructed(from.getyOnGround()) || data.fromWasReset && from.isHeadObstructed())
|
||||
final int blockdata = from.getData(from.getBlockX(), from.getBlockY(), from.getBlockZ());
|
||||
return
|
||||
// 0: Any envelope (supposedly normal) near 0 yDistance.
|
||||
yDistance > -2.0 * Magic.GRAVITY_MAX - Magic.GRAVITY_MIN && yDistance < 2.0 * Magic.GRAVITY_MAX + Magic.GRAVITY_MIN
|
||||
@@ -244,7 +263,7 @@ public class MagicAir {
|
||||
// 1: Bounce without velocity set. TODO: wat?
|
||||
//|| lastMove.yDistance == 0.0 && yDistance > -GRAVITY_MIN && yDistance < GRAVITY_SPAN
|
||||
// 1: Bounce with carpet.
|
||||
|| yDistance < 0.006
|
||||
//|| yDistance < 0.006
|
||||
)
|
||||
// 0: Jump-effect-specific
|
||||
// TODO: Jump effect at reduced lift off envelope -> skip this?
|
||||
@@ -260,18 +279,18 @@ public class MagicAir {
|
||||
|| data.liftOffEnvelope != LiftOffEnvelope.NORMAL
|
||||
&& (
|
||||
// 1: Wild-card allow half gravity near 0 yDistance. TODO: Check for removal of included cases elsewhere.
|
||||
lastMove.yDistance > -10.0 * Magic.GRAVITY_ODD / 2.0 && lastMove.yDistance < 10.0 * Magic.GRAVITY_ODD
|
||||
!(data.liftOffEnvelope.name().startsWith("LIMIT") && (Math.abs(yDistance) > 0.1 || blockdata > 3)) && lastMove.yDistance > -10.0 * Magic.GRAVITY_ODD / 2.0 && lastMove.yDistance < 10.0 * Magic.GRAVITY_ODD
|
||||
&& yDistance < lastMove.yDistance - Magic.GRAVITY_MIN / 2.0 && yDistance > lastMove.yDistance - Magic.GRAVITY_MAX
|
||||
// 1:
|
||||
|| lastMove.yDistance < Magic.GRAVITY_MAX + Magic.GRAVITY_SPAN && lastMove.yDistance > Magic.GRAVITY_ODD
|
||||
|| !data.liftOffEnvelope.name().startsWith("LIMIT") && lastMove.yDistance < Magic.GRAVITY_MAX + Magic.GRAVITY_SPAN && lastMove.yDistance > Magic.GRAVITY_ODD
|
||||
&& yDistance > 0.4 * Magic.GRAVITY_ODD && yDistance - lastMove.yDistance < -Magic.GRAVITY_ODD / 2.0
|
||||
// 1:
|
||||
|| lastMove.yDistance < 0.2 && lastMove.yDistance >= 0.0 && yDistance > -0.2 && yDistance < 2.0 * Magic.GRAVITY_MAX
|
||||
// 1:
|
||||
// 1: (damaged in liquid) ?
|
||||
|| lastMove.yDistance < 0.2 && lastMove.yDistance >= 0.0 && yDistance > -0.2 && yDistance < 2.0 * Magic.GRAVITY_MIN
|
||||
// 1: Reset condition?
|
||||
|| lastMove.yDistance > 0.4 * Magic.GRAVITY_ODD && lastMove.yDistance < Magic.GRAVITY_MIN && yDistance == 0.0
|
||||
// 1: Too small decrease, right after lift off.
|
||||
|| data.sfJumpPhase == 1 && lastMove.yDistance > -Magic.GRAVITY_ODD && lastMove.yDistance <= Magic.GRAVITY_MAX + Magic.GRAVITY_SPAN
|
||||
&& yDistance - lastMove.yDistance < 0.0114
|
||||
&& Math.abs(yDistance - lastMove.yDistance) < 0.0114
|
||||
// 1: Any leaving liquid and keeping distance once.
|
||||
|| data.sfJumpPhase == 1
|
||||
&& Math.abs(yDistance) <= Magic.swimBaseSpeedV(Bridge1_13.isSwimming(from.getPlayer())) && yDistance == lastMove.yDistance
|
||||
@@ -447,4 +466,4 @@ public class MagicAir {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+7
-4
@@ -15,7 +15,9 @@
|
||||
package fr.neatmonster.nocheatplus.checks.moving.magic;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
@@ -49,17 +51,18 @@ public class MagicLiquid {
|
||||
// TODO: liftOffEnvelope: refine conditions (general) , should be near water level.
|
||||
// TODO: 1.5 high blocks ?
|
||||
// TODO: Conditions seem warped.
|
||||
final int blockdata = from.getData(from.getBlockX(), from.getBlockY(), from.getBlockZ());
|
||||
if (yDistance <= 0.5) {
|
||||
if (lastMove.toIsValid && yDistance < lastMove.yDistance
|
||||
&& lastMove.yDistance - yDistance > Math.max(0.001, yDistance - baseSpeed)) {
|
||||
// Decrease more than difference to baseSpeed.
|
||||
return yDistance;
|
||||
}
|
||||
if (yDistance <= data.liftOffEnvelope.getMaxJumpGain(data.jumpAmplifier) && !BlockProperties.isLiquid(from.getTypeIdAbove())
|
||||
if (!(data.liftOffEnvelope == LiftOffEnvelope.LIMIT_LIQUID && Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(from.getPlayer())) && blockdata < 4) && (yDistance <= data.liftOffEnvelope.getMaxJumpGain(data.jumpAmplifier) && !BlockProperties.isLiquid(from.getTypeIdAbove())
|
||||
// TODO: What now !?
|
||||
|| !to.isInLiquid() // TODO: impossible !?
|
||||
|| (thisMove.to.onGround || lastMove.toIsValid && lastMove.yDistance - yDistance >= 0.010 || to.isAboveStairs())) {
|
||||
double vAllowedDistance = baseSpeed + 0.5;
|
||||
|| (thisMove.to.onGround || lastMove.toIsValid && lastMove.yDistance - yDistance >= 0.010 || to.isAboveStairs()))) {
|
||||
double vAllowedDistance = baseSpeed + (blockdata > 3 || data.liftOffEnvelope == LiftOffEnvelope.NORMAL ? 0.397 : 0.197); // asc by water level
|
||||
double vDistanceAboveLimit = yDistance - vAllowedDistance;
|
||||
if (vDistanceAboveLimit <= 0.0) {
|
||||
return vAllowedDistance;
|
||||
@@ -161,4 +164,4 @@ public class MagicLiquid {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+234
-35
@@ -23,6 +23,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
@@ -37,8 +38,11 @@ import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.ModelFlying;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.AccountEntry;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.SimpleEntry;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeEnchant;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
|
||||
import fr.neatmonster.nocheatplus.components.modifier.IAttributeAccess;
|
||||
@@ -99,24 +103,13 @@ public class CreativeFly extends Check {
|
||||
final ModelFlying model = thisMove.modelFlying;
|
||||
// TODO: Other set back policy for elytra, e.g. not set in narrow spaces?
|
||||
|
||||
// Proactive reset of elytraBoost (MC 1.11.2).
|
||||
if (data.fireworksBoostDuration > 0) {
|
||||
if (!lastMove.valid || lastMove.flyCheck != CheckType.MOVING_CREATIVEFLY
|
||||
|| lastMove.modelFlying != model
|
||||
|| data.fireworksBoostTickExpire < tick ) {
|
||||
data.fireworksBoostDuration = 0;
|
||||
}
|
||||
else {
|
||||
data.fireworksBoostDuration --;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate some distances.
|
||||
final double yDistance = thisMove.yDistance;
|
||||
final double hDistance = thisMove.hDistance;
|
||||
|
||||
final boolean flying = gameMode == BridgeMisc.GAME_MODE_SPECTATOR || player.isFlying();
|
||||
final boolean sprinting = time <= data.timeSprinting + cc.sprintingGrace;
|
||||
boolean lostground = false;
|
||||
|
||||
// Lost ground, if set so.
|
||||
if (model.getGround()) {
|
||||
@@ -125,21 +118,34 @@ public class CreativeFly extends Check {
|
||||
if (from.isSamePos(to)) {
|
||||
if (lastMove.toIsValid && lastMove.hDistance > 0.0 && lastMove.yDistance < -0.3 // Copy and paste from sf.
|
||||
&& LostGround.lostGroundStill(player, from, to, hDistance, yDistance, sprinting, lastMove, data, cc, tags)) {
|
||||
// Nothing to do.
|
||||
lostground = true;
|
||||
}
|
||||
}
|
||||
else if (LostGround.lostGround(player, from, to, hDistance, yDistance, sprinting, lastMove,
|
||||
data, cc, useBlockChangeTracker ? blockChangeTracker : null, tags)) {
|
||||
// Nothing to do.
|
||||
lostground = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Since still check NoFall on CreativeFly, need to exempt who has slow falling effect
|
||||
if (Bridge1_13.hasSlowfalling() && model.getScaleSlowfallingEffect()) {
|
||||
data.clearNoFallData();
|
||||
} else
|
||||
// Accounting for elytra fall damage
|
||||
if (Bridge1_9.isGlidingWithElytra(player) && thisMove.yDistance > -0.5) {
|
||||
data.clearNoFallData();
|
||||
}
|
||||
|
||||
workaroundSwitchingModel(player, thisMove, lastMove, model, data, cc);
|
||||
|
||||
// Horizontal distance check.
|
||||
double[] resH = hDist(player, from, to, hDistance, yDistance, sprinting, flying, lastMove, time, model, data, cc);
|
||||
double limitH = resH[0];
|
||||
double resultH = resH[1];
|
||||
|
||||
double[] rese = hackElytraH(player, from, to, hDistance, yDistance, thisMove, lastMove, lostground, data, cc);
|
||||
resultH = Math.max(resultH, rese[1]);
|
||||
// Check velocity.
|
||||
if (resultH > 0) {
|
||||
double hFreedom = data.getHorizontalFreedom();
|
||||
@@ -160,21 +166,21 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
|
||||
resultH *= 100.0; // Normalize to % of a block.
|
||||
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
// Sometimes resultH can be up to 18
|
||||
if (Bridge1_9.isGliding(player) && (Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && resultH<14.0) {
|
||||
resultH = 0.0;
|
||||
resultH = 0.0;
|
||||
}
|
||||
|
||||
|
||||
if (resultH > 0.0) {
|
||||
tags.add("hdist");
|
||||
}
|
||||
|
||||
// Vertical move.
|
||||
double limitV = 0.0; // Limit.
|
||||
double resultV = 0.0; // Violation (normalized to 100 * 1 block, applies if > 0.0).
|
||||
double resultV = rese[0]; // Violation (normalized to 100 * 1 block, applies if > 0.0).
|
||||
|
||||
// Distinguish checking method by y-direction of the move.
|
||||
if (yDistance > 0.0) {
|
||||
@@ -212,19 +218,25 @@ public class CreativeFly extends Check {
|
||||
resultV *= 100.0; // Normalize to % of a block.
|
||||
// Sometimes resultV can be up to 78
|
||||
if (Bridge1_9.isGliding(player) && (Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && resultV<60.0) {
|
||||
resultV = 0.0;
|
||||
resultV = 0.0;
|
||||
}
|
||||
if (resultV > 0.0) {
|
||||
tags.add("vdist");
|
||||
}
|
||||
|
||||
if (!player.isFlying() && !Double.isInfinite(Bridge1_9.getLevitationAmplifier(player))
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed()
|
||||
//Exempt check for 20 seconds after joined
|
||||
&& !(now > pData.getLastJoinTime() && pData.getLastJoinTime() + 20000 > now)
|
||||
&& !from.isInLiquid() && !BlockProperties.isNewLiq(from.getTypeId()) && from.getY() >= to.getY()) {
|
||||
resultV = Math.max(resultV,1.0);
|
||||
tags.add("antilevitate");
|
||||
if (lastMove.toIsValid && !player.isFlying() && !Double.isInfinite(Bridge1_9.getLevitationAmplifier(player)) && !Bridge1_9.isGlidingWithElytra(player)
|
||||
&& thisMove.modelFlying == lastMove.modelFlying
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed()
|
||||
//Exempt check for 20 seconds after joined
|
||||
&& !(now > pData.getLastJoinTime() && pData.getLastJoinTime() + 20000 > now)
|
||||
&& !from.isInLiquid() && !(thisMove.yDistance < 0.0 && lastMove.yDistance - thisMove.yDistance < 0.0001)) {
|
||||
double allowY = (lastMove.yDistance + (0.05D * (Bridge1_9.getLevitationAmplifier(player) + 1) - lastMove.yDistance) * 0.2D) * 0.98;
|
||||
if (lastMove.yDistance < 0.0 && thisMove.yDistance < allowY) {
|
||||
resultV = Math.max(resultV,1.0);
|
||||
tags.add("antilevitate");
|
||||
} else if (from.getY() >= to.getY() && !(thisMove.yDistance == 0.0 && allowY < 0.0)) {
|
||||
resultV = Math.max(resultV,1.0);
|
||||
tags.add("antilevitate");
|
||||
}
|
||||
}
|
||||
|
||||
final double result = Math.max(0.0, resultH) + Math.max(0.0, resultV);
|
||||
@@ -348,18 +360,18 @@ public class CreativeFly extends Check {
|
||||
else {
|
||||
fSpeed = 1.0;
|
||||
}
|
||||
|
||||
|
||||
double limitH = model.getHorizontalModSpeed() / 100.0 * ModelFlying.HORIZONTAL_SPEED * fSpeed;
|
||||
|
||||
if (from.isInWater() || to.isInWater() || BlockProperties.isNewLiq(from.getTypeId()) || BlockProperties.isNewLiq(to.getTypeId())) {
|
||||
if (from.isInWater() || to.isInWater()) {
|
||||
if (!Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) {
|
||||
limitH *= Magic.modDolphinsGrace;
|
||||
}
|
||||
}
|
||||
|
||||
if (model.getScaleSlowfallingEffect() && Bridge1_13.hasSlowfalling()) {
|
||||
Double Amplifier = PotionUtil.getPotionEffectAmplifier(from.getPlayer(), PotionEffectType.SPEED);
|
||||
limitH = Double.isInfinite(Amplifier) ? limitH : limitH + 0.1*(Amplifier +1);
|
||||
Double Amplifier = PotionUtil.getPotionEffectAmplifier(from.getPlayer(), PotionEffectType.SPEED);
|
||||
limitH = Double.isInfinite(Amplifier) ? limitH : limitH + 0.1*(Amplifier +1);
|
||||
}
|
||||
|
||||
if (lastMove.toIsValid) {
|
||||
@@ -421,8 +433,8 @@ public class CreativeFly extends Check {
|
||||
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);
|
||||
Double Amplifier = PotionUtil.getPotionEffectAmplifier(from.getPlayer(), PotionEffectType.JUMP);
|
||||
limitV += Double.isInfinite(Amplifier) ? 0.5 : 0.5 + 0.1*(Amplifier +1);
|
||||
}
|
||||
|
||||
// Related to elytra.
|
||||
@@ -430,6 +442,9 @@ public class CreativeFly extends Check {
|
||||
// TODO: Better detection of an elytra model (extra flags?).
|
||||
limitV = Math.max(limitV, limitV = hackLytra(yDistance, limitV, thisMove, lastMove, data));
|
||||
}
|
||||
if (Bridge1_9.isGlidingWithElytra(from.getPlayer()) &&
|
||||
(from.isInLiquid() || to.isInLiquid() || data.liqtick > 10)) // recently left water
|
||||
limitV = Math.max(limitV, 0.35);
|
||||
|
||||
if (model.getGravity()) {
|
||||
// Friction with gravity.
|
||||
@@ -438,7 +453,7 @@ public class CreativeFly extends Check {
|
||||
// TODO: Use last friction (as well)?
|
||||
double frictionDist = lastMove.yDistance * Magic.FRICTION_MEDIUM_AIR;
|
||||
if (!flying) {
|
||||
frictionDist -= Magic.GRAVITY_MIN;
|
||||
frictionDist -= 0.019;
|
||||
}
|
||||
if (frictionDist > limitV) {
|
||||
limitV = frictionDist;
|
||||
@@ -486,6 +501,129 @@ public class CreativeFly extends Check {
|
||||
return new double[] {limitV, resultV};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param from
|
||||
* @param to
|
||||
* @param hDistance
|
||||
* @param yDistance
|
||||
* @param thisMove
|
||||
* @param lastMove
|
||||
* @param lostground
|
||||
* @param data
|
||||
* @param player
|
||||
* @return resultH, resultV.
|
||||
*/
|
||||
private double[] hackElytraH(final Player player, final PlayerLocation from, final PlayerLocation to, final double hDistance, final double yDistance, final PlayerMoveData thisMove,
|
||||
final PlayerMoveData lastMove, final boolean lostground, final MovingData data, final MovingConfig cc) {
|
||||
/* Known false positives:
|
||||
* Still have setback with taking off ?
|
||||
* Fall into water
|
||||
* Some random falses with quick rotation ?
|
||||
*/
|
||||
if (!cc.elytraStrict || !Bridge1_9.isGlidingWithElytra(player)) return new double[] {0.0, 0.0};
|
||||
// Gliding in air
|
||||
if (lastMove.toIsValid && lastMove.modelFlying == thisMove.modelFlying && !from.isInLiquid()) {
|
||||
final Vector lookvec = to.getLocation().getDirection();
|
||||
final float f = to.getPitch() * 0.017453292F;
|
||||
final float lastf = lastMove.to.getPitch() * 0.017453292F;
|
||||
final float diff = Math.abs(f - lastf);
|
||||
double allwyDistance = lastMove.yDistance;
|
||||
double allwHDistance = 0.0;
|
||||
final double xzlength = Math.sqrt(lookvec.getX() * lookvec.getX() + lookvec.getZ() * lookvec.getZ());
|
||||
double f4 = Math.cos(f);
|
||||
f4 = f4 * f4;
|
||||
allwyDistance += -0.08D + f4 * 0.06D;
|
||||
double x = 0.0;
|
||||
double z = 0.0;
|
||||
if (allwyDistance < 0.0D) {
|
||||
final double d = allwyDistance * -0.1 * f4;
|
||||
x += lookvec.getX() * d / xzlength;
|
||||
z += lookvec.getZ() * d / xzlength;
|
||||
allwyDistance += d;
|
||||
}
|
||||
|
||||
// Look up
|
||||
if (f < 0.0F) {
|
||||
final double d = lastMove.hDistance * -Math.sin(f) * 0.04;
|
||||
x -= lookvec.getX() * d / xzlength;
|
||||
z -= lookvec.getZ() * d / xzlength;
|
||||
allwyDistance += d * 3.2;
|
||||
}
|
||||
x += lookvec.getX() / (xzlength*0.995) * lastMove.hDistance;
|
||||
z += lookvec.getZ() / (xzlength*0.995) * lastMove.hDistance;
|
||||
|
||||
// Fireworks
|
||||
// Can't be more precise due to some problems, still have ~15% faster bypasses :(
|
||||
if (data.fireworksBoostDuration > 0) {
|
||||
x += lookvec.getX() * 0.1D + (lookvec.getX() * 1.5D - x) * 0.5D;
|
||||
z += lookvec.getZ() * 0.1D + (lookvec.getZ() * 1.5D - z) * 0.5D;
|
||||
// Quick rotation problems
|
||||
if (Math.abs(f) > Math.abs(lastf)) if (diff > 1.9) allwHDistance += (diff - 0.6)/1.4; else allwHDistance += diff/1.4;
|
||||
// Problem with calculating fireworks duration and it end sooner. Speed after boost might be faster a little bit!
|
||||
if (f > 0.0 && f < 1.4 && Math.round(data.fireworksBoostTickNeedCheck / 4) > data.fireworksBoostDuration) allwHDistance += 0.24;
|
||||
allwHDistance += 0.12;
|
||||
// Speed isn't affected by fireworks in first tick
|
||||
if (data.fireworksBoostDuration >= data.fireworksBoostTickNeedCheck) allwHDistance += 0.65;
|
||||
tags.add("fw_speed");
|
||||
}
|
||||
|
||||
//System.out.println(allwyDistance + " " + yDistance + " diff:" + Math.abs(yDistance - allwyDistance * Magic.FRICTION_MEDIUM_AIR) + " diffl:" + diff);
|
||||
if (f > -0.11 && Math.abs(yDistance - allwyDistance * Magic.FRICTION_MEDIUM_AIR) > 0.005
|
||||
// Ignore fireworks, in water, lostground, slow_falling effect, velocity, honey block
|
||||
&& data.fireworksBoostDuration <= 0 && data.liqtick == 0 && !lostground && !data.isVelocityJumpPhase()
|
||||
&& Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player)) && !isCollideWithHB(from, to)
|
||||
) {
|
||||
tags.add("elytra_v_keep");
|
||||
return new double[] {yDistance == 0.0 ? 0.1 : Math.abs(yDistance), 0.0};
|
||||
}
|
||||
|
||||
// Adjust false
|
||||
allwHDistance += Math.sqrt(x*x +z*z) + (f < -1.37 ? 0.15 : 0.0);
|
||||
allwyDistance += allwyDistance > 0.0 ? 0.002 : (f < -1.37 ? (f < -1.5 ? -0.394 : -0.18) : -0.04);
|
||||
allwyDistance *= Magic.FRICTION_MEDIUM_AIR;
|
||||
|
||||
//System.out.println("f:" + f + " Hdist:" + hDistance + " allow:" + allwHDistance + " yDist:" + yDistance + " allowy:" + allwyDistance + " fwb:" + data.fireworksBoostDuration);
|
||||
if (data.fireworksBoostDuration <= 0) {
|
||||
if (yDistance > 0.0) {
|
||||
if (allwyDistance < yDistance
|
||||
// Inversion (neg -> pos).
|
||||
&& !(yDistance < Magic.GRAVITY_MIN && lastMove.yDistance > -Magic.GRAVITY_MAX - Magic.GRAVITY_MIN && lastMove.yDistance < 0.5 * Magic.GRAVITY_SPAN)) {
|
||||
tags.add("elytra_v_asc");
|
||||
return new double[] {yDistance, 0.0};
|
||||
}
|
||||
} else if (allwyDistance > yDistance
|
||||
// Inversion (neg -> pos , pos -> neg).
|
||||
&& !(allwyDistance > 0.0 && yDistance > -0.25)) {
|
||||
tags.add("elytra_v_desc");
|
||||
return new double[] {Math.abs(yDistance), 0.0};
|
||||
}
|
||||
}
|
||||
if (allwHDistance < hDistance) {
|
||||
tags.add("elytra_h_asc");
|
||||
return new double[] {0.0, hDistance - allwHDistance};
|
||||
}
|
||||
// Gliding in water
|
||||
// TODO: Will add later, look unstable
|
||||
} //else if(from.isInLiquid() && data.liqtick > 35) {
|
||||
// if (data.timeRiptiding + 4000 > System.currentTimeMillis()) return new double[] {0.0, 0.0};
|
||||
// double allwHDistance = Magic.DEFAULT_WALKSPEED * cc.survivalFlyWalkingSpeed / 100D;
|
||||
// if (data.fireworksBoostDuration > 0) allwHDistance = 1.6;
|
||||
// final int level = BridgeEnchant.getDepthStriderLevel(player);
|
||||
// if (level > 0) {
|
||||
// allwHDistance *= Magic.modDepthStrider[level];
|
||||
// }
|
||||
// if (!Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) allwHDistance *= 4.9;
|
||||
// if (data.fireworksBoostDuration > 0) allwHDistance = Math.max(allwHDistance, 1.8);
|
||||
// System.out.println(thisMove.hDistance + " " + allwHDistance);
|
||||
// if (thisMove.hDistance > allwHDistance) {
|
||||
// tags.add("elytra_hspeed(water)");
|
||||
// return new double[] {0.0, hDistance - allwHDistance};
|
||||
// }
|
||||
// }
|
||||
return new double[] {0.0, 0.0};
|
||||
}
|
||||
|
||||
private double hackLytra(final double yDistance, final double limitV, final PlayerMoveData thisMove, final PlayerMoveData lastMove, final MovingData data) {
|
||||
// TODO: Hack, move / config / something.
|
||||
// TODO: Confine more. hdist change relates to ydist change
|
||||
@@ -603,6 +741,67 @@ public class CreativeFly extends Check {
|
||||
return Math.max(maximumHeight - 10.0, world.getMaxHeight());
|
||||
}
|
||||
|
||||
private void workaroundSwitchingModel(final Player player, final PlayerMoveData thisMove, final PlayerMoveData lastMove, final ModelFlying model, final MovingData data, final MovingConfig cc) {
|
||||
if (lastMove.toIsValid) {
|
||||
// Other modelflying -> levitation
|
||||
// TODO: Better horizontal workaround
|
||||
if (data.bunnyhopTick > 0) data.bunnyhopTick--;
|
||||
if (lastMove.modelFlying != thisMove.modelFlying && thisMove.modelFlying.getScaleLevitationEffect()) {
|
||||
data.addVerticalVelocity(new SimpleEntry(0.0, 2));
|
||||
final double amount = guessFlyNoFlyVelocity(player, data.playerMoves.getCurrentMove(), lastMove, data);
|
||||
data.addHorizontalVelocity(new AccountEntry(amount, 2, MovingData.getHorVelValCount(amount)));
|
||||
data.bunnyhopTick = 20;
|
||||
if (thisMove.yDistance > 0.0) {
|
||||
data.yDis = thisMove.yDistance;
|
||||
data.addVerticalVelocity(new SimpleEntry(data.yDis, 1));
|
||||
} else {
|
||||
data.bunnyhopTick = 21;
|
||||
final double jumpamplifier = PotionUtil.getPotionEffectAmplifier(player, PotionEffectType.JUMP);
|
||||
data.yDis = 0.42 * (1 + 0.24*(Double.isInfinite(jumpamplifier) ? 0.0 : jumpamplifier + 1));
|
||||
data.addVerticalVelocity(new SimpleEntry(data.yDis, 2));
|
||||
}
|
||||
return;
|
||||
} else if (thisMove.modelFlying.getScaleLevitationEffect() && data.bunnyhopTick > 0 && thisMove.yDistance > 0.0 && thisMove.yDistance < data.yDis * 0.95) {
|
||||
if (data.bunnyhopTick == 20) return;
|
||||
data.yDis = (data.yDis + (0.05D * (Bridge1_9.getLevitationAmplifier(player) + 1) - data.yDis) * 0.2D) * Magic.FRICTION_MEDIUM_AIR;
|
||||
data.addVerticalVelocity(new SimpleEntry(thisMove.yDistance, 1));
|
||||
final double levitation = Bridge1_9.getLevitationAmplifier(player);
|
||||
if (thisMove.yDistance < 0.1 + 0.046 * (levitation > 0.0 ? levitation : 0.0)) data.bunnyhopTick = 0;
|
||||
return;
|
||||
} else if (thisMove.yDistance < 0.0) data.bunnyhopTick = 0;
|
||||
|
||||
//Gliding -> Creative
|
||||
if (lastMove.modelFlying != null && lastMove.modelFlying.getVerticalAscendGliding() && thisMove.modelFlying.getId().equals("gamemode.creative")) {
|
||||
final double amount = guessFlyNoFlyVelocity(player, data.playerMoves.getCurrentMove(), lastMove, data);
|
||||
data.addHorizontalVelocity(new AccountEntry(amount, 2, MovingData.getHorVelValCount(amount)));
|
||||
data.addVerticalVelocity(new SimpleEntry(0.0, 2));
|
||||
return;
|
||||
}
|
||||
// TODO: Levitation -> Slow_falling
|
||||
}
|
||||
}
|
||||
private static double guessFlyNoFlyVelocity(final Player player,
|
||||
final PlayerMoveData thisMove, final PlayerMoveData lastMove, final MovingData data) {
|
||||
// Default margin: Allow slightly less than the previous speed.
|
||||
final double defaultAmount = lastMove.hDistance * (1.0 + Magic.FRICTION_MEDIUM_AIR) / 2.0;
|
||||
// Test for exceptions.
|
||||
if (thisMove.hDistance > defaultAmount && Bridge1_9.isWearingElytra(player) && lastMove.modelFlying != null && lastMove.modelFlying.getId().equals(MovingConfig.ID_JETPACK_ELYTRA)) {
|
||||
// Allowing the same speed won't always work on elytra (still increasing, differing modeling on client side with motXYZ).
|
||||
// (Doesn't seem to be overly effective.)
|
||||
final PlayerMoveData secondPastMove = data.playerMoves.getSecondPastMove();
|
||||
if (secondPastMove.modelFlying != null && Magic.glideEnvelopeWithHorizontalGain(thisMove, lastMove, secondPastMove)) {
|
||||
return thisMove.hDistance + Magic.GLIDE_HORIZONTAL_GAIN_MAX;
|
||||
}
|
||||
}
|
||||
return defaultAmount;
|
||||
}
|
||||
|
||||
private boolean isCollideWithHB(PlayerLocation from ,PlayerLocation to) {
|
||||
final boolean a = BlockProperties.collides(to.getBlockCache(), to.getMinX() - 0.1, to.getMinY(), to.getMinZ() - 0.1, to.getMaxX() + 0.1, to.getMaxY(), to.getMaxZ() + 0.1, BlockProperties.F_STICKY) ||
|
||||
BlockProperties.collides(from.getBlockCache(), from.getMinX() - 0.1, from.getMinY(), from.getMinZ() - 0.1, from.getMaxX() + 0.1, from.getMaxY(), from.getMaxZ() + 0.1, BlockProperties.F_STICKY);
|
||||
return a;
|
||||
}
|
||||
|
||||
private void outpuDebugMove(final Player player, final double hDistance, final double limitH,
|
||||
final double yDistance, final double limitV, final ModelFlying model, final List<String> tags,
|
||||
final MovingData data) {
|
||||
@@ -631,4 +830,4 @@ public class CreativeFly extends Check {
|
||||
debug(player, builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,19 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.moving.player;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
@@ -28,9 +35,13 @@ import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.magic.Magic;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LocationData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeEnchant;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* A check to see if people cheat by tricking the server to not deal them fall damage.
|
||||
@@ -50,6 +61,7 @@ public class NoFall extends Check {
|
||||
|
||||
/** For temporary use: LocUtil.clone before passing deeply, call setWorld(null) after use. */
|
||||
private final Location useLoc = new Location(null, 0, 0, 0);
|
||||
private final Random random = new Random();
|
||||
|
||||
/**
|
||||
* Instantiates a new no fall check.
|
||||
@@ -84,8 +96,9 @@ public class NoFall extends Check {
|
||||
final IPlayerData pData) {
|
||||
// Damage to be dealt.
|
||||
final float fallDist = (float) getApplicableFallHeight(player, y, previousSetBackY, data);
|
||||
final double maxD = getDamage(fallDist);
|
||||
|
||||
double maxD = getDamage(fallDist);
|
||||
maxD = calcDamagewithfeatherfalling(player, calcReducedDamageByHB(player, maxD));
|
||||
fallOn(player, fallDist);
|
||||
if (maxD >= Magic.FALL_DAMAGE_MINIMUM) {
|
||||
// Check skipping conditions.
|
||||
if (cc.noFallSkipAllowFlight && player.getAllowFlight()) {
|
||||
@@ -109,6 +122,39 @@ public class NoFall extends Check {
|
||||
player.setFallDistance(0);
|
||||
}
|
||||
}
|
||||
|
||||
private void fallOn(final Player player, final double fallDist) {
|
||||
Block block = player.getLocation().subtract(0, 1, 0).getBlock();
|
||||
if (block.getType() == BridgeMaterial.FARMLAND && fallDist > 0.5 && random.nextFloat() < fallDist - 0.5) {
|
||||
final PlayerInteractEvent event = new PlayerInteractEvent(player, Action.PHYSICAL, null, block, BlockFace.SELF);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
//Move up a little bit in order not to stuck in a block
|
||||
player.setVelocity(player.getLocation().getDirection().clone().setY(0.0626).setX(-0.004).setZ(-0.004));
|
||||
block.setType(Material.DIRT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcDamagewithfeatherfalling(Player player, double damage) {
|
||||
if (!Bridge1_13.hasIsSwimming()) return damage;
|
||||
if (BridgeEnchant.hasFeatherFalling() && damage > 0.0) {
|
||||
int levelench = BridgeEnchant.getFeatherFallingLevel(player);
|
||||
if (levelench > 0) {
|
||||
int tmp = levelench * 3;
|
||||
if (tmp > 20) tmp = 20;
|
||||
return damage * (1.0 - tmp / 25.0);
|
||||
}
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
/** Calculate the damage was reduced by HoneyBlock */
|
||||
public static double calcReducedDamageByHB(final Player player ,final double damage) {
|
||||
final Material blockmat = player.getLocation().subtract(0, 0.5, 0).getBlock().getType();
|
||||
if ((BlockProperties.getBlockFlags(blockmat) & BlockProperties.F_STICKY) != 0) return Math.round(damage / 5);
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Estimate the applicable fall height for the given data.
|
||||
|
||||
+545
-213
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -553,7 +553,7 @@ public class VehicleChecks extends CheckListener {
|
||||
vehicleEnvelope.prepareCheckDetails(vehicle, moveInfo, thisMove);
|
||||
// Check.
|
||||
final SetBackEntry tempNewTo = vehicleEnvelope.check(player, vehicle,
|
||||
thisMove, fake, data, cc, pData);
|
||||
thisMove, fake, data, cc, pData, moveInfo);
|
||||
if (tempNewTo != null) {
|
||||
newTo = tempNewTo;
|
||||
}
|
||||
@@ -986,4 +986,4 @@ public class VehicleChecks extends CheckListener {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().debug(Streams.TRACE_FILE, builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+89
-33
@@ -20,6 +20,7 @@ import java.util.List;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@@ -47,6 +48,8 @@ import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.RichEntityLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* Vehicle moving envelope check, for Minecraft 1.9 and higher.
|
||||
@@ -115,7 +118,7 @@ public class VehicleEnvelope extends Check {
|
||||
public SetBackEntry check(final Player player, final Entity vehicle,
|
||||
final VehicleMoveData thisMove, final boolean isFake,
|
||||
final MovingData data, final MovingConfig cc,
|
||||
final IPlayerData pData) {
|
||||
final IPlayerData pData, final VehicleMoveInfo moveInfo) {
|
||||
final boolean debug = pData.isDebugActive(type);
|
||||
// Delegate to a sub-check.
|
||||
tags.clear();
|
||||
@@ -125,7 +128,7 @@ public class VehicleEnvelope extends Check {
|
||||
data.ws.setJustUsedIds(debugDetails); // Add just used workaround ids to this list directly, for now.
|
||||
}
|
||||
final boolean violation = checkEntity(player, vehicle, thisMove, isFake,
|
||||
data, cc, debug);
|
||||
data, cc, debug, moveInfo);
|
||||
if (debug && !debugDetails.isEmpty()) {
|
||||
debugDetails(player);
|
||||
debugDetails.clear();
|
||||
@@ -161,12 +164,14 @@ public class VehicleEnvelope extends Check {
|
||||
debugDetails.clear();
|
||||
}
|
||||
|
||||
private double getHDistCap(final EntityType type, final MovingConfig cc) {
|
||||
private double getHDistCap(final EntityType type, final MovingConfig cc, final VehicleMoveData thisMove) {
|
||||
final Double v = cc.vehicleEnvelopeHorizontalSpeedCap.get(type);
|
||||
if (v == null) {
|
||||
if (type == EntityType.BOAT && (thisMove.from.onIce || thisMove.to.onIce)) return 4.1;
|
||||
return cc.vehicleEnvelopeHorizontalSpeedCap.get(null);
|
||||
}
|
||||
else {
|
||||
if (type == EntityType.BOAT && (thisMove.from.onIce || thisMove.to.onIce)) return v * 2.5;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
@@ -174,15 +179,15 @@ public class VehicleEnvelope extends Check {
|
||||
private boolean checkEntity(final Player player, final Entity vehicle,
|
||||
final VehicleMoveData thisMove, final boolean isFake,
|
||||
final MovingData data, final MovingConfig cc,
|
||||
final boolean debug) {
|
||||
final boolean debug, final VehicleMoveInfo moveInfo) {
|
||||
boolean violation = false;
|
||||
long now = System.currentTimeMillis();
|
||||
if (debug) {
|
||||
debugDetails.add("inair: " + data.sfJumpPhase);
|
||||
}
|
||||
|
||||
if (isBubbleColumn(vehicle.getLocation())) {
|
||||
data.timeVehicletoss = System.currentTimeMillis();
|
||||
if (isBubbleColumn(moveInfo.from)
|
||||
|| (isBouncingBlock(moveInfo.from) && thisMove.yDistance >= 0.0 && thisMove.yDistance <= 1.0)) {
|
||||
data.timeVehicletoss = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// Medium dependent checking.
|
||||
@@ -194,10 +199,10 @@ public class VehicleEnvelope extends Check {
|
||||
if (vehicle instanceof LivingEntity) {
|
||||
Double speed = PotionUtil.getPotionEffectAmplifier((LivingEntity)vehicle, PotionEffectType.SPEED);
|
||||
if (!Double.isInfinite(speed)) {
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc) * (1 + 0.2 * (speed+1)))) return true;
|
||||
} else if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc))) return true;
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc, thisMove) * (1 + 0.2 * (speed+1)))) return true;
|
||||
} else if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc, thisMove) + (checkDetails.canJump ? 0.18 : 0.0))) return true;
|
||||
} else
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc))) { // Override type for now.
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc, thisMove))) { // Override type for now.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -271,7 +276,7 @@ public class VehicleEnvelope extends Check {
|
||||
}
|
||||
else if (checkDetails.inAir) {
|
||||
// In-air move.
|
||||
if (checkInAir(thisMove, data, debug, vehicle)) {
|
||||
if (checkInAir(thisMove, data, debug, vehicle, moveInfo)) {
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
@@ -311,6 +316,61 @@ public class VehicleEnvelope extends Check {
|
||||
tags.add("descend_much");
|
||||
violation = true;
|
||||
}
|
||||
|
||||
if (vehicle instanceof LivingEntity) {
|
||||
final VehicleMoveData firstPastMove = data.vehicleMoves.getFirstPastMove();
|
||||
if (thisMove.hDistance > 0.1D && thisMove.yDistance == 0D && !thisMove.to.onGround && !thisMove.from.onGround
|
||||
&& firstPastMove.valid && firstPastMove.yDistance == 0D
|
||||
&& thisMove.to.inWater && thisMove.from.inWater
|
||||
&& !thisMove.headObstructed // TODO: Might decrease margin here.
|
||||
) {
|
||||
// TODO: Relative hdistance.
|
||||
// TODO: Might check actual bounds (collidesBlock). Might implement + use BlockProperties.getCorrectedBounds or getSomeHeight.
|
||||
violation = true;
|
||||
tags.add("waterwalk");
|
||||
}
|
||||
Block blockUnder = vehicle.getLocation().subtract(0, 0.3, 0).getBlock();
|
||||
Material blockAbove = vehicle.getLocation().add(0, 0.10, 0).getBlock().getType();
|
||||
if (blockUnder != null && blockAbove != null && blockUnder.getType().toString().endsWith("WATER")) {
|
||||
if (blockAbove == Material.AIR) {
|
||||
// hDist and vDist checks, simply checks for horizontal movement with little y distance
|
||||
if (thisMove.hDistance > 0.11D && thisMove.yDistance <= 0.1D && !thisMove.to.onGround && !thisMove.from.onGround
|
||||
&& firstPastMove.valid && firstPastMove.yDistance == thisMove.yDistance || firstPastMove.yDistance == thisMove.yDistance * -1 && firstPastMove.yDistance != 0D
|
||||
&& !thisMove.headObstructed) {
|
||||
// Prevent being flagged if a vehicle transitions from a block to water and the player falls into the water.
|
||||
if (!(thisMove.yDistance < 0 && thisMove.yDistance != 0 && firstPastMove.yDistance < 0 && firstPastMove.yDistance != 0)) {
|
||||
violation = true;
|
||||
tags.add("watermove");
|
||||
}
|
||||
}
|
||||
//Bouncing on water
|
||||
//if (!violation && firstPastMove.valid && !thisMove.to.onGround && !thisMove.from.onGround
|
||||
//&& (thisMove.from.getY() < thisMove.to.getY()) && !(firstPastMove.from.inLiquid && !thisMove.to.inLiquid)
|
||||
//&& !firstPastMove.from.onGround && !thisMove.headObstructed) {
|
||||
// boolean tag = false;
|
||||
// if (Bridge1_13.hasIsSwimming()) {
|
||||
// if (((Levelled)blockUnder.getBlockData()).getLevel() == 0) tag = true;
|
||||
// } else if (blockUnder.getData() == 0) tag = true;
|
||||
// Block blockUnder2 = blockUnder.getRelative(BlockFace.DOWN);
|
||||
// if (checkDetails.canJump) {
|
||||
// if (BlockProperties.isGround(blockUnder2.getType()))
|
||||
// tag = false;
|
||||
// else {
|
||||
// if (BlockProperties.isGround(blockUnder2.getRelative(BlockFace.EAST).getType())
|
||||
// || BlockProperties.isGround(blockUnder2.getRelative(BlockFace.WEST).getType())
|
||||
// || BlockProperties.isGround(blockUnder2.getRelative(BlockFace.NORTH).getType())
|
||||
// || BlockProperties.isGround(blockUnder2.getRelative(BlockFace.SOUTH).getType())
|
||||
// ) tag = false;
|
||||
// }
|
||||
// }
|
||||
// if (tag) {
|
||||
// violation = true;
|
||||
// tags.add("waterjump");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!violation) {
|
||||
// No violation.
|
||||
@@ -337,25 +397,14 @@ public class VehicleEnvelope extends Check {
|
||||
return violation;
|
||||
}
|
||||
|
||||
private boolean isBubbleColumn(Location from) {
|
||||
if (!Bridge1_13.hasIsSwimming()) return false;
|
||||
if (from.getBlock().getType() == Material.BUBBLE_COLUMN) {
|
||||
return true;
|
||||
}
|
||||
World w = from.getWorld();
|
||||
int x = from.getBlockX();
|
||||
int y = from.getBlockY();
|
||||
int z = from.getBlockZ();
|
||||
if (w.getBlockAt(x + 1,y,z).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
if (w.getBlockAt(x - 1,y,z).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
if (w.getBlockAt(x,y,z + 1).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
if (w.getBlockAt(x,y,z - 1).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
if (w.getBlockAt(x + 1,y,z - 1).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
if (w.getBlockAt(x + 1,y,z + 1).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
if (w.getBlockAt(x - 1,y,z - 1).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
if (w.getBlockAt(x - 1,y,z + 1).getType() == Material.BUBBLE_COLUMN) return true;
|
||||
return false;
|
||||
private boolean isBouncingBlock(RichEntityLocation from) {
|
||||
return BlockProperties.collides(from.getBlockCache(), from.getMinX(), from.getMinY() - 1.0, from.getMinZ(), from.getMaxX(), from.getMaxY(), from.getMaxZ(), BlockProperties.F_BOUNCE25);
|
||||
}
|
||||
|
||||
private boolean isBubbleColumn(RichEntityLocation from) {
|
||||
if (!Bridge1_13.hasIsSwimming()) return false;
|
||||
return BlockProperties.collidesId(from.getBlockCache(), from.getMinX(), from.getMinY(), from.getMinZ(), from.getMaxX(), from.getMaxY(), from.getMaxZ(), Material.BUBBLE_COLUMN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare checkDetails according to vehicle-specific interpretation of side
|
||||
@@ -432,7 +481,9 @@ public class VehicleEnvelope extends Check {
|
||||
* @return
|
||||
*/
|
||||
private boolean checkInAir(final VehicleMoveData thisMove, final MovingData data,
|
||||
final boolean debug, final Entity vehicle) {
|
||||
final boolean debug, final Entity vehicle, final VehicleMoveInfo moveInfo) {
|
||||
final RichEntityLocation from = moveInfo.from;
|
||||
final RichEntityLocation to = moveInfo.to;
|
||||
|
||||
// TODO: Distinguish sfJumpPhase and inAirDescendCount (after reaching the highest point).
|
||||
|
||||
@@ -468,8 +519,9 @@ public class VehicleEnvelope extends Check {
|
||||
final double maxDescend = getInAirMaxDescend(thisMove, data);
|
||||
if (data.sfJumpPhase > (checkDetails.canJump ? MagicVehicle.maxJumpPhaseAscend : 1)
|
||||
&& thisMove.yDistance > Math.max(minDescend, -checkDetails.gravityTargetSpeed)) {
|
||||
if (!(vehicle instanceof LivingEntity && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier((LivingEntity)vehicle)))) {
|
||||
tags.add("slow_fall_vdist");
|
||||
if (ColliesHoneyBlock(from)) data.sfJumpPhase = 5; else
|
||||
if (!(vehicle instanceof LivingEntity && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier((LivingEntity)vehicle)))) {
|
||||
tags.add("slow_fall_vdist");
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
@@ -519,5 +571,9 @@ public class VehicleEnvelope extends Check {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean ColliesHoneyBlock(RichEntityLocation from) {
|
||||
return BlockProperties.collides(from.getBlockCache(), from.getMinX() - 0.1, from.getMinY(), from.getMinZ() - 0.1, from.getMaxX() + 0.1, from.getMaxY() + 0.3, from.getMaxZ() + 0.1, BlockProperties.F_STICKY);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ public class NetConfig extends ACheckConfig {
|
||||
Permissions.NET_FLYINGFREQUENCY,
|
||||
Permissions.NET_KEEPALIVEFREQUENCY,
|
||||
Permissions.NET_PACKETFREQUENCY,
|
||||
Permissions.NET_WRONGTURN,
|
||||
};
|
||||
|
||||
public static RegisteredPermission[] getPreferKeepUpdatedPermissions() {
|
||||
@@ -57,10 +58,6 @@ public class NetConfig extends ACheckConfig {
|
||||
public final float attackFrequencyLimitSecondsEight;
|
||||
public final float attackFrequencyImprobableWeight;
|
||||
public final ActionList attackFrequencyActions;
|
||||
|
||||
public final int fightSyncResetCount;
|
||||
public final int fightSyncThreshold;
|
||||
public final ActionList fightSyncActions;
|
||||
|
||||
public final int flyingFrequencySeconds;
|
||||
public final double flyingFrequencyPPS;
|
||||
@@ -75,6 +72,8 @@ public class NetConfig extends ACheckConfig {
|
||||
public final float packetFrequencyPacketsPerSecond;
|
||||
public final int packetFrequencySeconds;
|
||||
public final ActionList packetFrequencyActions;
|
||||
|
||||
public final ActionList wrongTurnActions;
|
||||
|
||||
/** Maximum distance for lightning effects (squared). */
|
||||
public final double soundDistanceSq;
|
||||
@@ -96,10 +95,6 @@ public class NetConfig extends ACheckConfig {
|
||||
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);
|
||||
fightSyncThreshold = config.getInt(ConfPaths.NET_FIGHTSYNC_THRESHOLD);
|
||||
fightSyncActions = config.getOptimizedActionList(ConfPaths.NET_FIGHTSYNC_ACTIONS, Permissions.NET_ATTACKFREQUENCY);
|
||||
|
||||
flyingFrequencySeconds = Math.max(1, globalConfig.getInt(ConfPaths.NET_FLYINGFREQUENCY_SECONDS));
|
||||
flyingFrequencyPPS = Math.max(1.0, globalConfig.getDouble(ConfPaths.NET_FLYINGFREQUENCY_PACKETSPERSECOND));
|
||||
flyingFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_FLYINGFREQUENCY_ACTIONS, Permissions.NET_FLYINGFREQUENCY);
|
||||
@@ -119,6 +114,8 @@ public class NetConfig extends ACheckConfig {
|
||||
packetFrequencyPacketsPerSecond = config.getInt(ConfPaths.NET_PACKETFREQUENCY_PPS);
|
||||
packetFrequencySeconds = config.getInt(ConfPaths.NET_PACKETFREQUENCY_SECONDS);
|
||||
packetFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_PACKETFREQUENCY_ACTIONS, Permissions.NET_PACKETFREQUENCY);
|
||||
|
||||
wrongTurnActions = config.getOptimizedActionList(ConfPaths.NET_WRONGTURN_ACTIONS, Permissions.NET_WRONGTURN);
|
||||
|
||||
double dist = config.getDouble(ConfPaths.NET_SOUNDDISTANCE_MAXDISTANCE);
|
||||
soundDistanceSq = dist * dist;
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.util.LinkedList;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.access.ACheckData;
|
||||
@@ -35,18 +34,12 @@ import fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency;
|
||||
*
|
||||
*/
|
||||
public class NetData extends ACheckData {
|
||||
|
||||
public double fightSyncVL;
|
||||
|
||||
// Reentrant lock.
|
||||
private final Lock lock = new ReentrantLock();
|
||||
|
||||
// AttackFrequency
|
||||
public ActionFrequency attackFrequencySeconds = new ActionFrequency(16, 500);
|
||||
|
||||
public Location lastHitLocation;
|
||||
public int fightSyncReset;
|
||||
public int fightSyncCount;
|
||||
|
||||
// FlyingFrequency
|
||||
/** All flying packets, use System.currentTimeMillis() for time. */
|
||||
@@ -54,6 +47,7 @@ public class NetData extends ACheckData {
|
||||
public boolean flyingFrequencyOnGround = false;
|
||||
public long flyingFrequencyTimeOnGround = 0L;
|
||||
public long flyingFrequencyTimeNotOnGround = 0L;
|
||||
public double diffpacketVLs = 0;
|
||||
/**
|
||||
* Monitors redundant packets, when more than 20 packets per second are
|
||||
* sent. Use System.currentTimeMillis() for time.
|
||||
@@ -66,6 +60,9 @@ public class NetData extends ACheckData {
|
||||
* time of the last event. System.currentTimeMillis() is used.
|
||||
*/
|
||||
public ActionFrequency keepAliveFreq = new ActionFrequency(20, 1000);
|
||||
|
||||
// Wrong Turn
|
||||
public double wrongTurnVL = 0;
|
||||
|
||||
// Shared.
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.net;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
|
||||
public class WrongTurn extends Check {
|
||||
|
||||
public WrongTurn() {
|
||||
super(CheckType.NET_WRONGTURN);
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final float pitch, final NetData data, final NetConfig cc) {
|
||||
boolean cancel = false;
|
||||
|
||||
if (Math.abs(pitch) > 90.0 || pitch < -90.0) {
|
||||
data.wrongTurnVL++;
|
||||
|
||||
if (executeActions(player, data.wrongTurnVL, 1, cc.wrongTurnActions).willCancel()) {
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,6 +37,8 @@ public final class BridgeEnchant {
|
||||
private final static Enchantment THORNS = parseEnchantment("THORNS");
|
||||
|
||||
private final static Enchantment RIPTIDE = parseEnchantment("RIPTIDE");
|
||||
|
||||
private final static Enchantment FEATHER_FALLING = parseEnchantment("PROTECTION_FALL");
|
||||
|
||||
/**
|
||||
* Retrieve the maximum level for an enchantment, present in armor slots.
|
||||
@@ -92,6 +94,10 @@ public final class BridgeEnchant {
|
||||
public static boolean hasDepthStrider() {
|
||||
return DEPTH_STRIDER != null;
|
||||
}
|
||||
|
||||
public static boolean hasFeatherFalling() {
|
||||
return FEATHER_FALLING != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the player might return some damage due to the "thorns"
|
||||
@@ -104,6 +110,17 @@ public final class BridgeEnchant {
|
||||
return hasArmor(player, THORNS);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return Maximum level of FEATHER_FALLING found on armor items, capped at 4.
|
||||
* Will return 0 if not available.
|
||||
*/
|
||||
public static int getFeatherFallingLevel(final Player player) {
|
||||
// Cap at three.
|
||||
return Math.min(4, getMaxLevelArmor(player, FEATHER_FALLING));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
|
||||
@@ -291,6 +291,8 @@ public class BridgeMaterial {
|
||||
"stone_brick_stairs", "smooth_stairs");
|
||||
public static final Material STONE_PRESSURE_PLATE = getFirstNotNull(
|
||||
"stone_pressure_plate", "stone_plate");
|
||||
public static final Material WOODEN_PRESSURE_PLATE = getFirstNotNull(
|
||||
"wooden_pressure_plate", "wood_plate", "acacia_pressure_plate", "birch_pressure_plate", "dark_oak_pressure_plate", "jungle_pressure_plate", "oak_pressure_plate", "spruce_pressure_plate");
|
||||
public static final Material STONE_SLAB = getFirstNotNull("stone_slab", "step");
|
||||
|
||||
public static final Material SUGAR_CANE = getFirstNotNull("sugar_cane_block", "sugar_cane"); // Reversed
|
||||
|
||||
+6
@@ -79,6 +79,12 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
// Shulker boxes.
|
||||
for (Material mat : MaterialUtil.SHULKER_BOXES) {
|
||||
BlockFlags.addFlags(mat, BlockProperties.F_XZ100 | BlockFlags.SOLID_GROUND);
|
||||
BlockProperties.setBlockProps(mat, new BlockProps(BlockProperties.woodPickaxe, 2,
|
||||
BlockProperties.secToMs(3.0, 1.45, 0.7, 0.45, 0.35, 0.2)));
|
||||
}
|
||||
|
||||
for (Material mat : MaterialUtil.INFESTED_BLOCKS) {
|
||||
BlockProperties.setBlockProps(mat, BlockProperties.instantType);
|
||||
}
|
||||
|
||||
// Stone types.
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ public class BlocksMC1_14 implements BlockPropertiesSetup{
|
||||
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);
|
||||
BlockFlags.addFlags("SWEET_BERRY_BUSH", BlockProperties.F_COBWEB | BlockProperties.F_COBWEB2);
|
||||
StaticLog.logInfo("Added block-info for Minecraft 1.14 blocks.");
|
||||
}
|
||||
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.BlockPropertiesSetup;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
public class BlocksMC1_15 implements BlockPropertiesSetup{
|
||||
public BlocksMC1_15() {
|
||||
BlockInit.assertMaterialExists("BEEHIVE");
|
||||
BlockInit.assertMaterialExists("BEE_NEST");
|
||||
BlockInit.assertMaterialExists("HONEY_BLOCK");
|
||||
BlockInit.assertMaterialExists("HONEYCOMB_BLOCK");
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void setupBlockProperties(WorldConfigProvider<?> worldConfigProvider) {
|
||||
BlockFlags.addFlags("BEEHIVE", BlockFlags.FULLY_SOLID_BOUNDS);
|
||||
BlockFlags.addFlags("BEE_NEST", BlockFlags.FULLY_SOLID_BOUNDS);
|
||||
BlockFlags.addFlags("HONEYCOMB_BLOCK", BlockFlags.FULLY_SOLID_BOUNDS);
|
||||
BlockFlags.addFlags("HONEY_BLOCK", BlockFlags.SOLID_GROUND | BlockProperties.F_STICKY);
|
||||
|
||||
BlockProperties.setBlockProps("BEEHIVE", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.6f, BlockProperties.secToMs(0.85, 0.425, 0.225, 0.13, 0.11, 0.7)));
|
||||
BlockProperties.setBlockProps("BEE_NEST", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.3f, BlockProperties.secToMs(0.4, 0.225, 0.11, 0.05, 0.042, 0.0)));
|
||||
BlockProperties.setBlockProps("HONEYCOMB_BLOCK", new BlockProperties.BlockProps(BlockProperties.noTool, 0.6f));
|
||||
BlockProperties.setBlockProps("HONEY_BLOCK", BlockProperties.instantType);
|
||||
StaticLog.logInfo("Added block-info for Minecraft 1.15 blocks.");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class BlocksMC1_5 implements BlockPropertiesSetup {
|
||||
////////////////////
|
||||
|
||||
// 78 Snow
|
||||
BlockFlags.addFlags("SNOW", BlockProperties.F_HEIGHT_8_INC);
|
||||
BlockFlags.addFlags("SNOW", BlockProperties.F_HEIGHT_8_INC | BlockProperties.F_XZ100 | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockFlags.removeFlags("SNOW", BlockProperties.F_HEIGHT_8SIM_INC);
|
||||
|
||||
StaticLog.logInfo("Added block-info for Minecraft 1.5 blocks.");
|
||||
|
||||
+1
@@ -41,6 +41,7 @@ public class VanillaBlocksFactory {
|
||||
setups.add(new BlocksMC1_12());
|
||||
setups.add(new BlocksMC1_13());
|
||||
setups.add(new BlocksMC1_14());
|
||||
setups.add(new BlocksMC1_15());
|
||||
}
|
||||
catch(Throwable t){}
|
||||
for (final BlockPropertiesSetup setup : setups){
|
||||
|
||||
@@ -288,6 +288,9 @@ public abstract class ConfPaths {
|
||||
|
||||
private static final String BLOCKPLACE_SCAFFOLD = BLOCKPLACE + "scaffold.";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_CHECK = BLOCKPLACE_SCAFFOLD + SUB_ACTIVE;
|
||||
public static final String BLOCKPLACE_SCAFFOLD_ANGLE = BLOCKPLACE_SCAFFOLD + "angle";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_TIME = BLOCKPLACE_SCAFFOLD + "time";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_SPRINT = BLOCKPLACE_SCAFFOLD + "sprint";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_ACTIONS = BLOCKPLACE_SCAFFOLD + "actions";
|
||||
|
||||
private static final String BLOCKPLACE_SPEED = BLOCKPLACE + "speed.";
|
||||
@@ -473,6 +476,7 @@ public abstract class ConfPaths {
|
||||
public static final String FIGHT_CANCELDEAD = FIGHT + "canceldead";
|
||||
public static final String FIGHT_TOOLCHANGEPENALTY = FIGHT + "toolchangepenalty";
|
||||
private static final String FIGHT_PVP = FIGHT + "pvp.";
|
||||
public static final String FIGHT_MAXLOOPLETENCYTICKS = FIGHT + "maxloopletencyticks";
|
||||
public static final String FIGHT_PVP_KNOCKBACKVELOCITY = FIGHT_PVP + "knockbackvelocity";
|
||||
|
||||
private static final String FIGHT_ANGLE = FIGHT + "angle.";
|
||||
@@ -484,12 +488,6 @@ public abstract class ConfPaths {
|
||||
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)?
|
||||
@@ -499,6 +497,9 @@ public abstract class ConfPaths {
|
||||
private static final String FIGHT_DIRECTION = FIGHT + "direction.";
|
||||
public static final String FIGHT_DIRECTION_CHECK = FIGHT_DIRECTION + SUB_ACTIVE;
|
||||
public static final String FIGHT_DIRECTION_STRICT = FIGHT_DIRECTION + "strict";
|
||||
public static final String FIGHT_DIRECTION_FAILALL = FIGHT_DIRECTION + "failall";
|
||||
public static final String FIGHT_DIRECTION_LOOPPRECISION = FIGHT_DIRECTION + "loopprecision";
|
||||
public static final String FIGHT_DIRECTION_STRICTANGLEPRECISION = FIGHT_DIRECTION + "strictangleprecision";
|
||||
public static final String FIGHT_DIRECTION_PENALTY = FIGHT_DIRECTION + "penalty";
|
||||
public static final String FIGHT_DIRECTION_ACTIONS = FIGHT_DIRECTION + "actions";
|
||||
|
||||
@@ -533,6 +534,7 @@ public abstract class ConfPaths {
|
||||
|
||||
public static final String FIGHT_SELFHIT = FIGHT + "selfhit.";
|
||||
public static final String FIGHT_SELFHIT_CHECK = FIGHT_SELFHIT + SUB_ACTIVE;
|
||||
public static final String FIGHT_SELFHIT_EXCLUDEPROJECTILE = FIGHT_SELFHIT + "excludeprojectile";
|
||||
public static final String FIGHT_SELFHIT_ACTIONS = FIGHT_SELFHIT + "actions";
|
||||
|
||||
|
||||
@@ -552,11 +554,7 @@ public abstract class ConfPaths {
|
||||
public static final String FIGHT_SPEED_IMPROBABLE_FEEDONLY = FIGHT_SPEED_IMPROBABLE + "feedonly";
|
||||
public static final String FIGHT_SPEED_IMPROBABLE_WEIGHT = FIGHT_SPEED_IMPROBABLE + "weight";
|
||||
public static final String FIGHT_SPEED_ACTIONS = FIGHT_SPEED + "actions";
|
||||
|
||||
private static final String FIGHT_WRONGTURN = FIGHT + "wrongturn.";
|
||||
public static final String FIGHT_WRONGTURN_CHECK = FIGHT_WRONGTURN + SUB_ACTIVE;
|
||||
public static final String FIGHT_WRONGTURN_ACTIONS = FIGHT_WRONGTURN + "actions";
|
||||
|
||||
|
||||
private static final String FIGHT_YAWRATE = FIGHT + "yawrate.";
|
||||
public static final String FIGHT_YAWRATE_CHECK = FIGHT_YAWRATE + SUB_ACTIVE;
|
||||
|
||||
@@ -636,6 +634,8 @@ public abstract class ConfPaths {
|
||||
public static final String MOVING_CREATIVEFLY_IGNOREALLOWFLIGHT = MOVING_CREATIVEFLY + "ignoreallowflight";
|
||||
public static final String MOVING_CREATIVEFLY_MODEL = MOVING_CREATIVEFLY + SUB_MODEL + ".";
|
||||
public static final String MOVING_CREATIVEFLY_ACTIONS = MOVING_CREATIVEFLY + "actions";
|
||||
public static final String MOVING_CREATIVEFLY_EYTRA_FWRESET = MOVING_CREATIVEFLY_MODEL + "elytra.resetFwOnground";
|
||||
public static final String MOVING_CREATIVEFLY_EYTRA_STRICT = MOVING_CREATIVEFLY_MODEL + "elytra.strict";
|
||||
|
||||
private static final String MOVING_MOREPACKETS = MOVING + "morepackets.";
|
||||
public static final String MOVING_MOREPACKETS_CHECK = MOVING_MOREPACKETS + SUB_ACTIVE;
|
||||
@@ -695,6 +695,13 @@ public abstract class ConfPaths {
|
||||
public static final String MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE = MOVING_SURVIVALFLY_SETBACKPOLICY + "falldamage";
|
||||
public static final String MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID = MOVING_SURVIVALFLY_SETBACKPOLICY + "voidtovoid";
|
||||
public static final String MOVING_SURVIVALFLY_ACTIONS = MOVING_SURVIVALFLY + "actions";
|
||||
private static final String MOVING_SURVIVALFLY_VLFREQUENCY = MOVING_SURVIVALFLY_LENIENCY + "violationfrequency.";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_ACTIVE = MOVING_SURVIVALFLY_VLFREQUENCY + "active";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_DEBUG = MOVING_SURVIVALFLY_VLFREQUENCY + "debug";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MAXTOTALVLS = MOVING_SURVIVALFLY_VLFREQUENCY + "maxleniencyvl";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MINADDEDVLS = MOVING_SURVIVALFLY_VLFREQUENCY + "mintoadd";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MOVECOUNT = MOVING_SURVIVALFLY_VLFREQUENCY + "movecount";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MOREVLS = MOVING_SURVIVALFLY_VLFREQUENCY + "morevls";
|
||||
|
||||
@GlobalConfig
|
||||
public static final String MOVING_SURVIVALFLY_HOVER = MOVING_SURVIVALFLY + "hover.";
|
||||
@@ -770,12 +777,6 @@ public abstract class ConfPaths {
|
||||
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.";
|
||||
public static final String NET_FIGHTSYNC_ACTIVE = NET_FIGHTSYNC + SUB_ACTIVE;
|
||||
public static final String NET_FIGHTSYNC_THRESHOLD = NET_FIGHTSYNC + "threshold";
|
||||
public static final String NET_FIGHTSYNC_RESETCOUNT = NET_FIGHTSYNC + "reset_count";
|
||||
public static final String NET_FIGHTSYNC_ACTIONS = NET_FIGHTSYNC + "actions";
|
||||
|
||||
private static final String NET_FLYINGFREQUENCY = NET + "flyingfrequency.";
|
||||
public static final String NET_FLYINGFREQUENCY_ACTIVE = NET_FLYINGFREQUENCY + SUB_ACTIVE;
|
||||
@@ -810,6 +811,10 @@ public abstract class ConfPaths {
|
||||
private static final String NET_SUPERSEDED = NET + "superseded.";
|
||||
private static final String NET_SUPERSEDED_FLYING = NET_SUPERSEDED + "flying.";
|
||||
public static final String NET_SUPERSEDED_FLYING_CANCELWAITING = NET_SUPERSEDED_FLYING + "cancelwaiting";
|
||||
|
||||
private static final String NET_WRONGTURN = NET + "wrongturn.";
|
||||
public static final String NET_WRONGTURN_ACTIVE = NET_WRONGTURN + SUB_ACTIVE;
|
||||
public static final String NET_WRONGTURN_ACTIONS = NET_WRONGTURN + "actions";
|
||||
|
||||
public static final String STRINGS = "strings";
|
||||
|
||||
@@ -948,6 +953,10 @@ public abstract class ConfPaths {
|
||||
public static final String FIGHT_CRITICAL_CANCEL_CANCEL = "checks.fight.critical.cancel.cancel";
|
||||
@Deprecated
|
||||
public static final String FIGHT_CRITICAL_CANCEL_DIVIDEDAMAGE = "checks.fight.critical.cancel.dividedamage";
|
||||
@Deprecated // Does this need to be done?
|
||||
private static final String FIGHT_CLICKPATTERN = "checks.fight.clickpattern";
|
||||
@Deprecated
|
||||
private static final String NET_FIGHTSYNC = "checks.net.fightsync";
|
||||
|
||||
/**
|
||||
* Get moved paths for which an annotation doesn't work.
|
||||
@@ -972,4 +981,4 @@ public abstract class ConfPaths {
|
||||
return entries;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import org.bukkit.Material;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
|
||||
/**
|
||||
* These are the default settings for NoCheatPlus. They will be used in addition to/in replacement of configurations
|
||||
@@ -32,8 +33,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
// TODO: Other version details ?
|
||||
|
||||
private static final String unifiedBlockDirectionActions = "cancel vl>10 log:bdirection:0:3:if cancel";
|
||||
private static final String unifiedBlockReachActions = "cancel vl>5 log:breach:0:2:if cancel";
|
||||
private static final String unifiedBlockDirectionActions = "vl>1 cancel vl>15 cancel log:bdirection:4:8:i vl>200 cancel log:bdirection:1:5:if cmdc:kickillegalblockinteract:1:5";
|
||||
private static final String unifiedBlockReachActions = "cancel log:breach:5:6:i";
|
||||
|
||||
/**
|
||||
* Instantiates a new default configuration.
|
||||
@@ -64,7 +65,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.LOGGING_BACKEND_FILE_PREFIX, "", 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_FILE_FILENAME, "nocheatplus.log", 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_INGAMECHAT_ACTIVE, true, 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_INGAMECHAT_PREFIX, "&cNCP: &f", 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_INGAMECHAT_PREFIX, "&7&l[&cNC+&7&l]&7 ", 1154);
|
||||
|
||||
// Data settings.
|
||||
// Expired offline players data.
|
||||
@@ -81,7 +82,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.PERMISSIONS_POLICY_DEFAULT, "ALWAYS", 1140);
|
||||
set(ConfPaths.PERMISSIONS_POLICY_RULES, Arrays.asList(
|
||||
"nocheatplus.notify :: INTERVAL:60, -world, -offline", // Not sure about this one.
|
||||
"nocheatplus.admin.debug :: INTERVAL:5",
|
||||
"nocheatplus.admin.debug :: INTERVAL:10",
|
||||
"nocheatplus.admin* :: ALWAYS",
|
||||
// TODO: Command permissions are always checked anyway :p. Will be changed...
|
||||
"nocheatplus.command* :: ALWAYS",
|
||||
@@ -93,10 +94,10 @@ public class DefaultConfig extends ConfigFile {
|
||||
*/
|
||||
"nocheatplus.checks.chat.relog :: INTERVAL:10",
|
||||
"nocheatplus.checks.chat.logins :: INTERVAL:10",
|
||||
"nocheatplus.checks.chat.* :: INTERVAL:2",
|
||||
"nocheatplus.checks.net.* :: INTERVAL:2",
|
||||
"nocheatplus.checks.moving.survivalfly.* :: INTERVAL:5" // (Excludes the sf base permission.)
|
||||
), 1142);
|
||||
"nocheatplus.checks.chat.* :: INTERVAL:4",
|
||||
"nocheatplus.checks.net.* :: INTERVAL:4",
|
||||
"nocheatplus.checks.moving.survivalfly.* :: INTERVAL:10" // (Excludes the sf base permission.)
|
||||
), 1154);
|
||||
|
||||
// Protection features.
|
||||
// Hide plugins.
|
||||
@@ -113,44 +114,44 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.PROTECT_CLIENTS_MOTD_ACTIVE, true, 785);
|
||||
set(ConfPaths.PROTECT_CLIENTS_MOTD_ALLOWALL, false, 785);
|
||||
|
||||
|
||||
/* Checks! */
|
||||
set(ConfPaths.CHECKS_ACTIVE, true, 1144);
|
||||
set(ConfPaths.CHECKS_LAG, true, 1144);
|
||||
set(ConfPaths.CHECKS_DEBUG, false, 1144);
|
||||
|
||||
|
||||
/* BlockBreak */
|
||||
set(ConfPaths.BLOCKBREAK_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_DIRECTION_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_DIRECTION_ACTIONS, unifiedBlockDirectionActions, 1097);
|
||||
set(ConfPaths.BLOCKBREAK_DIRECTION_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_STRICT, true, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 100, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 95, 785); //100
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL, 100, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE, 2000, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_ACTIONS, "cancel vl>0 log:fastbreak:3:5:cif cancel", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_ACTIONS, "cancel vl>5 cancel log:fastbreak:4:2:i vl>50 cancel log:fastbreak:0:2:if cmdc:kickfastbreak:2:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_MOD_CREATIVE, 95, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_MOD_SURVIVAL, 45, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_SHORTTERM_TICKS, 5, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_SHORTTERM_LIMIT, 7, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_ACTIONS, "cancel vl>5 log:bbfrequency:3:5:if cancel vl>60 log:bbfrequency:0:5:cif cancel cmd:kickfrequency", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_ACTIONS, "cancel vl>5 log:bbfrequency:3:5:i cancel vl>40 log:bbfrequency:0:5:if cancel cmdc:kickfrequency:0:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_NOSWING_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:if cancel", 785);
|
||||
set(ConfPaths.BLOCKBREAK_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:i cancel", 785);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_REACH_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_REACH_ACTIONS, unifiedBlockReachActions, 785);
|
||||
set(ConfPaths.BLOCKBREAK_REACH_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_LEVEL, 10, 785);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_LEVEL, 20, 1154);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_IMPROBABLE_WEIGHT, 2.0, 1154);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_ACTIONS, "cancel vl>10 log:bwrong:0:5:if cancel vl>30 log:bwrong:0:5:cif cancel cmd:kickwb", 785);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_ACTIONS, "cancel vl>10 log:bwrong:2:5:i cancel vl>30 log:bwrong:0:5:if cancel cmdc:kickwb:0:5", 1154);
|
||||
|
||||
/* BlockInteract */
|
||||
set(ConfPaths.BLOCKINTERACT_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.BLOCKINTERACT_DIRECTION_CHECK, "default", 785);
|
||||
@@ -161,77 +162,79 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_INTERVAL, 2000, 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_LIMIT, 60, 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_ACTIONS, "cancel vl>200 log:bspeed:0:2:if cancel vl>1000 cancel log:bspeed:0:2:icf cmd:kickbspeed", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_LIMIT, 55, 1154); // Old limit: 60
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_ACTIONS, "cancel vl>10 cancel log:bspeed:5:4:i cancel vl>500 cancel log:bspeed:0:5:icf cmdc:kickbspeed:2:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKINTERACT_VISIBLE_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_VISIBLE_ACTIONS, "cancel vl>100 log:bvisible:0:10:if cancel", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_VISIBLE_ACTIONS, "cancel vl>30 log:bvisible:8:5:if cancel", 1154); // Visible + stone generators = fps NCP issue #575
|
||||
|
||||
|
||||
// BLOCKPLACE
|
||||
/* BlockPlace */
|
||||
set(ConfPaths.BLOCKPLACE_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_AGAINST_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_AGAINST_ACTIONS, "cancel", 785);
|
||||
set(ConfPaths.BLOCKPLACE_AGAINST_ACTIONS, "cancel log:against:1:5:i vl>10 cancel log:against:0:2:if cmdc:kickagainst:0:10", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_AUTOSIGN_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_AUTOSIGN_SKIPEMPTY, false, 785);
|
||||
set(ConfPaths.BLOCKPLACE_AUTOSIGN_ACTIONS, "cancel vl>10 log:bautosign:0:3:if cancel", 785);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_DIRECTION_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_DIRECTION_ACTIONS, unifiedBlockDirectionActions, 785);
|
||||
set(ConfPaths.BLOCKPLACE_DIRECTION_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_LIMIT, 22, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_LIMIT, 15, 1154); // Old limit: 22
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_TICKS, 10, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_LIMIT, 6, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_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_FASTPLACE_ACTIONS, "cancel vl>5 cancel log:fastplace:8:3:i vl>20 cancel log:fastplace:2:4:i vl>80 cancel log:fastplace:0:10:if cmdc:kickfastplace:1:10", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_REACH_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_REACH_ACTIONS, unifiedBlockReachActions, 785);
|
||||
set(ConfPaths.BLOCKPLACE_REACH_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_EXCEPTIONS, Arrays.asList("LILY_PAD", Material.FLINT_AND_STEEL.toString()), 785);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:if cancel", 785);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_EXCEPTIONS, Arrays.asList(BridgeMaterial.LILY_PAD.toString(), Material.FLINT_AND_STEEL.toString()), 1154);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_ACTIONS, "cancel vl>10 log:noswing:2:5:i cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_CHECK, "default", 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_ACTIONS, "vl>15 log:scaffold:0:6:if", 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_ANGLE, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_SPRINT, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_TIME, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_ACTIONS, "vl>1 cancel vl>10 cancel log:scaffold:3:7:if vl>60 cancel log:scaffold:1:2:if cmdc:kickscaffold:2:10 cmd:clearscaffold:0:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_INTERVAL, 45L, 785);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_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);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_INTERVAL, 30L, 1154); // Old limit: 45L < FPs with throwable potions.
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_FEEDONLY, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_WEIGHT, 0.3, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_ACTIONS, "cancel vl>100 log:bpspeed:6:7:i cancel vl>1000 log:bpspeed:3:5:if cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_PREVENTMISC_BOATSANYWHERE, true);
|
||||
|
||||
|
||||
/* Chat */
|
||||
set(ConfPaths.CHAT_ACTIVE, "default", 1144);
|
||||
|
||||
// Captcha.
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHECK, "false", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_SKIP_COMMANDS, false, 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHARACTERS, "abcdefghjkmnpqrtuvwxyzABCDEFGHJKMNPQRTUVWXYZ2346789", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHARACTERS, "abcdefghjkmnpqrtuvwxyzABCDEFGHJKMNPQRTUVWXYZ2346789!?><", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_LENGTH, 6, 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_QUESTION, "&cPlease type '&6[captcha]&c' to continue sending messages/commands.", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_SUCCESS, "&aOK, it sounds like you're not a spambot.", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_QUESTION, "&c&l(!)&7 Please type '&6[captcha]&7' to continue using chat.", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_SUCCESS, "&c&l(!)&7 Antispam check passed.", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_TRIES, 3, 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_ACTIONS, "cancel cmd:kickcaptcha vl>4 log:captcha:2:5:cf cancel cmd:kickcaptcha", 785);
|
||||
|
||||
set(ConfPaths.CHAT_COLOR_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_COLOR_ACTIONS, "log:color:0:1:if cancel", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_ACTIONS, "cancel cmdc:kickcaptcha vl>4 log:captcha:2:5:cf cancel cmdc:kickcaptcha", 785);
|
||||
// This check should be subject to removal
|
||||
set(ConfPaths.CHAT_COLOR_CHECK, "false", 1154);
|
||||
set(ConfPaths.CHAT_COLOR_ACTIONS, "cancel", 1154);
|
||||
|
||||
|
||||
set(ConfPaths.CHAT_COMMANDS_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_EXCLUSIONS, new ArrayList<String>(), 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_HANDLEASCHAT, Arrays.asList("me"), 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_EXCLUSIONS, Arrays.asList("undo", "redo"), 1154);
|
||||
set(ConfPaths.CHAT_COMMANDS_HANDLEASCHAT, Arrays.asList("me", "msg", "emsg", "essentials:msg", "tell", "etell", "essentials:tell", "say", "esay", "essentials:say", "whisper", "ewhisper", "essentials:whisper", "w", "essentials:w", "ew", "r", "er", "essentials:r", "reply", "essentials:reply", "ereply"), 1154);
|
||||
set(ConfPaths.CHAT_COMMANDS_LEVEL, 10, 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_SHORTTERM_TICKS, 18, 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_SHORTTERM_LEVEL, 3, 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_ACTIONS, "log:commands:0:5:cf cancel cmd:kickcommands vl>20 log:commands:0:5:cf cancel cmd:tempkick1", 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_ACTIONS, "log:commands:0:5:cf cancel cmdc:kickcommands vl>20 log:commands:0:5:cf cancel cmdc:tempkick1", 1154);
|
||||
|
||||
// Text (ordering on purpose).
|
||||
set(ConfPaths.CHAT_TEXT_CHECK, "default", 785);
|
||||
@@ -240,57 +243,57 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_FACTOR, 0.9D, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_WEIGHT, 6, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_LEVEL, 160, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_ACTIONS, "cancel cmd:tellchatnormal vl>7 log:chatnormal:0:5:f cancel cmd:tellchatnormal vl>20 log:chatnormal:0:5:cf cancel cmd:kickchatnormal vl>40 log:chatnormal:0:5:cf cancel cmd:kickchat5", 785);
|
||||
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_ACTIONS, "cancel cmdc:tellchatnormal vl>7 log:chatnormal:0:5:cif cancel cmdc:tellchatnormal vl>20 log:chatnormal:0:5:cif cancel cmdc:kickchatnormal vl>40 log:chatnormal:0:5:cif cancel cmdc:kickchat5", 1154);
|
||||
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_MIN, 2.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_FACTOR, 0.7, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_WEIGHT, 3.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_LEVEL, 20.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_ACTIONS, "log:chatfast:0:5:cf cancel cmd:kickchatfast vl>20 log:chatfast:0:5:cf cancel cmd:kickchat1 vl>40 log:chatfast:0:5:cf cancel cmd:kickchat5", 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_ACTIONS, "log:chatfast:2:3:icf cancel cmdc:kickchatfast:0:5 vl>20 cancel log:chatfast:0:5:cif cmdc:kickchatfast vl>40 cancel log:chatfast:0:5:cif cmdc:kickchat1", 1154);
|
||||
// Message
|
||||
set(ConfPaths.CHAT_TEXT_MSG_LETTERCOUNT, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_PARTITION, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_UPPERCASE, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_UPPERCASE, 1.2, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_AFTERJOIN, 1.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_NOMOVING, 1.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATCANCEL, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_NOMOVING, 1.1, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATCANCEL, 2.0, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATGLOBAL, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATSELF, 1.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_LENGTHAV, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_LENGTHMSG, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_NOLETTER, 0.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_NOLETTER, 0.2, 1154);
|
||||
// Global
|
||||
set(ConfPaths.CHAT_TEXT_GL_CHECK, true, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WEIGHT, 0.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WORDS_CHECK, false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WORDS_CHECK, true, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WEIGHT, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_PREFIXES_CHECK , false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_SIMILARITY_CHECK , false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_SIMILARITY_CHECK , true, 1154);
|
||||
// Player
|
||||
set(ConfPaths.CHAT_TEXT_PP_CHECK, true, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_WORDS_CHECK, false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_PREFIXES_CHECK, false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_SIMILARITY_CHECK , false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_WORDS_CHECK, true, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_PP_PREFIXES_CHECK, true, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_PP_SIMILARITY_CHECK , true, 1154);
|
||||
// Warning (commands + chat).
|
||||
set(ConfPaths.CHAT_WARNING_CHECK, true, 785);
|
||||
set(ConfPaths.CHAT_WARNING_LEVEL, 67, 785);
|
||||
set(ConfPaths.CHAT_WARNING_MESSAGE, "&e>>>\n&e>>> &cPlease &eslow down &cchat, &eyou might get kicked &cfor spam.\n&e>>>", 785);
|
||||
set(ConfPaths.CHAT_WARNING_MESSAGE, "\n &c&l(!)&7 Please slow down chat, you might get kicked by the antispam.\n \n", 1154);
|
||||
set(ConfPaths.CHAT_WARNING_TIMEOUT, 10, 785);
|
||||
// Relog
|
||||
set(ConfPaths.CHAT_RELOG_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_RELOG_TIMEOUT, 5000L, 785);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_MESSAGE, "&cYou relogged really fast! If you keep doing that, you're going to be banned.", 785);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_MESSAGE, "&c&l(!)&7 You relogged really fast! If you keep doing that, you're going to be banned.", 1154);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_NUMBER, 1, 785);
|
||||
set(ConfPaths.CHAT_RELOG_KICKMESSAGE, "Too fast re-login, try with a little delay.", 785);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_TIMEOUT, 60000L, 785);
|
||||
set(ConfPaths.CHAT_RELOG_ACTIONS, "log:relog:0:10:cf cancel vl>20 log:relog:0:10:cf cancel cmd:tempkick5", 785);
|
||||
set(ConfPaths.CHAT_RELOG_ACTIONS, "log:relog:0:10:cf cancel vl>20 log:relog:0:10:cf cancel cmdc:tempkick5", 1154);
|
||||
// Logins
|
||||
set(ConfPaths.CHAT_LOGINS_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_LOGINS_STARTUPDELAY, 600, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_PERWORLDCOUNT, false, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_SECONDS, 10, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_LIMIT, 10, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_KICKMESSAGE, "Too many people logging in, retry soon.", 785);
|
||||
set(ConfPaths.CHAT_LOGINS_KICKMESSAGE, "Too many players are logging in at the same time, please try again later.", 1154);
|
||||
|
||||
/*
|
||||
* Combined !
|
||||
@@ -299,15 +302,15 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.COMBINED_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.COMBINED_BEDLEAVE_CHECK, "default", 785);
|
||||
set(ConfPaths.COMBINED_BEDLEAVE_ACTIONS, "cancel log:bedleave:0:5:if cmd:kickbedleave", 785);
|
||||
set(ConfPaths.COMBINED_BEDLEAVE_ACTIONS, "cancel log:bedleave:0:5:if cmdc:kickbedleave", 1154);
|
||||
|
||||
set(ConfPaths.COMBINED_ENDERPEARL_CHECK, "default", 785);
|
||||
set(ConfPaths.COMBINED_ENDERPEARL_CHECK, true, 1154); // 'default' activation flag issue
|
||||
set(ConfPaths.COMBINED_ENDERPEARL_PREVENTCLICKBLOCK, true, 785);
|
||||
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_CHECK , "default", 785);
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_LEVEL, 300, 785);
|
||||
// set(ConfPaths.COMBINED_IMPROBABLE_FASTBREAK_CHECK, false, 785);
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_ACTIONS, "cancel log:improbable:2:8:if", 785);
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_ACTIONS, "cancel vl>10 log:improbable:8:9:if cancel vl>1500 cancel log:improbable:0:10:if cmdc:kickimprobable:0:10 cmdc:clearimprobable:0:10", 1154);
|
||||
|
||||
set(ConfPaths.COMBINED_INVULNERABLE_CHECK, true, 785); // Not a check type yet.
|
||||
set(ConfPaths.COMBINED_INVULNERABLE_TRIGGERS_ALWAYS, false, 785);
|
||||
@@ -320,89 +323,92 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.COMBINED_MUNCHHAUSEN_ACTIONS, "cancel vl>100 cancel log:munchhausen:0:60:if", 785);
|
||||
|
||||
// (No active flag set !?)
|
||||
set(ConfPaths.COMBINED_YAWRATE_RATE , 380, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR, 1.0, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN, 250, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MAX, 2000, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_RATE , 290, 1154); // Old limit: 360
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR, 2.0, 1154); // 1.0
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN, 450, 1154); // 250
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MAX, 2500, 1154); // 1500
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_WEIGHT, 100.0, 1154);
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_WEIGHT, 90.0, 1154); // 100.0
|
||||
// set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE, true, 785);
|
||||
|
||||
// FIGHT
|
||||
set(ConfPaths.FIGHT_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.FIGHT_CANCELDEAD, true, 785);
|
||||
set(ConfPaths.FIGHT_TOOLCHANGEPENALTY, 500L, 785);
|
||||
set(ConfPaths.FIGHT_MAXLOOPLETENCYTICKS, 8, 1154);
|
||||
set(ConfPaths.FIGHT_TOOLCHANGEPENALTY, 0L, 1154); // Disabled for now, it interferes too much with pvp. 500L
|
||||
set(ConfPaths.FIGHT_PVP_KNOCKBACKVELOCITY, "default", 785);
|
||||
|
||||
set(ConfPaths.FIGHT_YAWRATE_CHECK, true, 785); // Not a check type.
|
||||
|
||||
set(ConfPaths.FIGHT_ANGLE_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_MOVE, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_TIME, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_YAW, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_MOVE, 100, 1154); // Move is problematic with mob grinders and in a 2 VS 1 scenario.
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_TIME, 200, 1154); // Time is problematic with mob grinders and in a 2 VS 1 scenario.
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_YAW, 60, 1154);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_SWITCH, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_ACTIONS, "cancel vl>100 log:angle:3:5:f cancel vl>250 log:angle:0:5:cif cancel", 785);
|
||||
|
||||
set(ConfPaths.FIGHT_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_ANGLE_ACTIONS, "cancel vl>100 log:angle:4:5:i cancel vl>500 log:angle:0:20:if cancel", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_CRITICAL_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_CRITICAL_FALLDISTANCE, 0.06251, 785);
|
||||
set(ConfPaths.FIGHT_CRITICAL_ACTIONS, "cancel vl>50 log:critical:0:5:cif cancel", 785);
|
||||
// Old value: 0.06251. NCP seems to be unable to catch packet-critical cheats with this value, although it has nearly no false positives.
|
||||
set(ConfPaths.FIGHT_CRITICAL_FALLDISTANCE, 0.075, 785);
|
||||
set(ConfPaths.FIGHT_CRITICAL_ACTIONS, "vl>2 cancel vl>50 cancel log:critical:10:9:i vl>100 cancel cmd:clearcritical:0:10", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_DIRECTION_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_STRICT, false, 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_PENALTY, 500L, 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_ACTIONS,
|
||||
"cancel vl>5 log:fdirection:3:5:f cancel vl>20 log:fdirection:0:5:if cancel vl>50 log:fdirection:0:5:cif cancel", 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_STRICT, true, 1154);
|
||||
set(ConfPaths.FIGHT_DIRECTION_FAILALL, true, 1154);
|
||||
set(ConfPaths.FIGHT_DIRECTION_PENALTY, 75L, 1154);
|
||||
set(ConfPaths.FIGHT_DIRECTION_ACTIONS, "vl>2 log:fdirectionlowvl:9:10:i vl>5 log:fdirectionlowvl:5:4:i vl>10 cancel log:fdirection:2:4:if vl>50 cancel log:fdirection:0:7:icf cmdc:kicksuspiciouscombat:1:5", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_FASTHEAL_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_INTERVAL, 4000L, 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_BUFFER, 1000L, 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_ACTIONS, "cancel vl>10 cancel log:fastheal:0:10:i vl>30 cancel log:fastheal:0:10:if", 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_ACTIONS, "cancel vl>10 cancel log:fastheal:2:6:i vl>30 cancel log:fastheal:1:1:i vl>90 cancel log:fastheal:0:10:if cmdc:kickfastheal:0:10", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_GODMODE_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_GODMODE_LAGMINAGE, 1100, 785); // TODO: ndt/2 => 500-600.
|
||||
set(ConfPaths.FIGHT_GODMODE_LAGMAXAGE, 5000, 785);
|
||||
set(ConfPaths.FIGHT_GODMODE_ACTIONS, "log:godmode:2:5:if cancel vl>60 log:godmode:2:5:icf cancel", 785); // cmd:kickgod", 785);
|
||||
set(ConfPaths.FIGHT_GODMODE_ACTIONS, "cancel log:godmode:0:5:icf cmdc:kickgod:0:5", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_NOSWING_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:if cancel", 785);
|
||||
set(ConfPaths.FIGHT_NOSWING_ACTIONS, "vl>2 cancel vl>10 log:noswing:1:5:i cancel", 1154);
|
||||
// TODO: Merge @CaptainObvious' pitchpattern check in this fork.
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_CHECK, "default", 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_ALWAYSACTIVE, false, 1154); // <- Cinematic/Zoom-like mods issue.
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_LIMIT, 10F, 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_SAMPLE, 35, 1154);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_DIFF, 0.001D, 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_DELTAGCD, 0.00001F, 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_ACTIONS, "vl>2 cancel vl>10 cancel log:pitchpattern:5:6:i vl>100 cancel log:pitchpattern:0:10:icf cmdc:kickillegalrotations:3:10", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_REACH_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_REACH_SURVIVALDISTANCE, 4.4, 785);
|
||||
set(ConfPaths.FIGHT_REACH_PENALTY, 500, 785);
|
||||
set(ConfPaths.FIGHT_REACH_SURVIVALDISTANCE, 4.22, 1154); // 4.4
|
||||
set(ConfPaths.FIGHT_REACH_PENALTY, 250, 1154);
|
||||
set(ConfPaths.FIGHT_REACH_REDUCE, true, 785);
|
||||
set(ConfPaths.FIGHT_REACH_REDUCEDISTANCE, 0.9, 785);
|
||||
set(ConfPaths.FIGHT_REACH_REDUCESTEP, 0.15, 785);
|
||||
set(ConfPaths.FIGHT_REACH_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_REACH_ACTIONS, "vl>1 log:freach:8:9:i vl>5 cancel log:freach:2:6:if vl>12 cancel log:kreach:1:5:i vl>35 cancel log:kreach:0:5:if cmdc:kicksuspiciouscombat:2:1", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_SELFHIT_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_SELFHIT_ACTIONS, "log:fselfhit:0:5:if cancel vl>10 log:fselfhit:0:5:icf cancel cmd:kickselfhit", 785);
|
||||
set(ConfPaths.FIGHT_SELFHIT_EXCLUDEPROJECTILE, false, 1154);
|
||||
set(ConfPaths.FIGHT_SELFHIT_ACTIONS, "cancel log:fselfhit:0:5:icf cmdc:kickselfhit:0:5", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_SPEED_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_SPEED_LIMIT, 15, 785);
|
||||
set(ConfPaths.FIGHT_SPEED_ACTIONS, "cancel vl>50 log:fspeed:0:5:if cancel", 785);
|
||||
set(ConfPaths.FIGHT_SPEED_LIMIT, 15, 1154);
|
||||
set(ConfPaths.FIGHT_SPEED_ACTIONS, "cancel vl>20 cancel log:fspeed:2:5:i vl>80 cancel log:fspeed:1:1:if cmd:kickattackfrequency:0:10", 1154);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_TICKS, 7, 785);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_LIMIT, 6, 785);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_LIMIT, 5, 1154);
|
||||
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);
|
||||
|
||||
|
||||
set(ConfPaths.INVENTORY_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.INVENTORY_DROP_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_DROP_LIMIT, 100, 785);
|
||||
set(ConfPaths.INVENTORY_DROP_LIMIT, 10, 1154);
|
||||
set(ConfPaths.INVENTORY_DROP_TIMEFRAME, 20L, 785);
|
||||
set(ConfPaths.INVENTORY_DROP_ACTIONS, "log:drop:0:1:cif cancel cmd:dropkick:0:1", 785);
|
||||
set(ConfPaths.INVENTORY_DROP_ACTIONS, "log:drop:0:5:if cancel cmdc:dropkick:0:5", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_EXCLUDE, Arrays.asList("Inventory Name Here"), 1154);
|
||||
@@ -410,33 +416,34 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_TWEAKS1_5, true, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_SHORTTERM, 4, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_NORMAL, 15, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_CHEST, 152, 1154);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_CHEST, 155, 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_FASTCLICK_ACTIONS, "cancel vl>200 cancel log:fastclick:7:5:i vl>600 cancel log:fastclick:1:5:if vl>5000 cancel log:fastclick:1:2:if cmdc:kickfastclick:2:15", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_STRICT, true, 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_DELAY, 130, 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_DELAY, 75, 1154);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_IMPROBABLE_FEEDONLY, false, 1085);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_IMPROBABLE_WEIGHT, 0.6, 1085);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_ACTIONS, "cancel vl>15 log:instantbow:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_ACTIONS, "cancel vl>15 cancel log:instantbow:4:5:i vl>200 cancel log:instantbow:0:10:if cmdc:kickbow:2:10", 1154);
|
||||
|
||||
// TODO: Set this to false as default?
|
||||
set(ConfPaths.INVENTORY_INSTANTEAT_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTEAT_ACTIONS, "log:instanteat:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTEAT_ACTIONS, "log:instanteat:2:5:i cancel", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_DURATION, 0.7, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_DURATION, 1.4, 1154); // The actual consumption time needed would be 1.5s. Set to 1.4 for leniency
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_WHITELIST, false, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ITEMS, new LinkedList<String>(), 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ACTIONS, "log:fastconsume:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ITEMS, Arrays.asList("DRIED_KELP"), 1154);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ACTIONS, "cancel vl>2 log:fastconsume:2:5:if cancel vl>35 cancel log:fastconsume:0:5:if cmdc:kickfastconsume:0:5", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_CHECK, "default", 1153);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_DISABLECREATIVE, true, 1153);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, "log:inventorymove:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, "log:inventorymove:2:5:i cancel", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_PAGELIMIT, 50, 1154);
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_ACTIONS, "cancel log:gutenberg:0:10:icf cmd:kickinvaliddata", 785);
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_ACTIONS, "cancel log:gutenberg:0:10:if cmdc:kickinvaliddata:0:5", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_ITEMS_CHECK, "default", 785);
|
||||
|
||||
@@ -446,12 +453,12 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
set (ConfPaths.INVENTORY_HOTFIX_DUPE_FALLINGBLOCKENDPORTAL, true, 785);
|
||||
|
||||
// MOVING
|
||||
/* Moving ! */
|
||||
set(ConfPaths.MOVING_ACTIVE, "default", 1144);
|
||||
|
||||
// CreativeFly
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNOREALLOWFLIGHT, true, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNORECREATIVE, false, 785); // TODO: -> true ?
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNORECREATIVE, false, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "creative." + ConfPaths.SUB_HORIZONTAL_SPEED, 100, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "creative." + ConfPaths.SUB_VERTICAL_ASCEND_SPEED, 100, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "creative." + ConfPaths.SUB_VERTICAL_MAXHEIGHT, 128, 785);
|
||||
@@ -486,23 +493,26 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_VERTICAL_ASCEND_SPEED, 0, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_VERTICAL_MAXHEIGHT, 128, 1104);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_MODIFIERS, false, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_EYTRA_FWRESET, false, 1154);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_EYTRA_STRICT, false, 1154);
|
||||
}
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_ACTIONS,
|
||||
"log:flyfile:3:5:f cancel"
|
||||
+ " vl>100 log:flyshort:0:5:i log:flyfile:0:5:f cancel"
|
||||
+ " vl>400 log:flylong:0:5:i log:flyfile:0:5:cf cancel"
|
||||
, 1080);
|
||||
|
||||
"cancel log:flyfile:3:5:f"
|
||||
+ " vl>100 cancel log:creativefly:8:9:i log:flyfile:0:10:f"
|
||||
+ " vl>900 cancel log:creativefly:2:4:i log:flyfile:0:5:cf"
|
||||
+ " vl>2000 cancel log:creativefly:0:5:icf cmdc:kickfly:0:15 cmd:clearcf:0:15"
|
||||
, 1154);
|
||||
// MorePackets
|
||||
set(ConfPaths.MOVING_MOREPACKETS_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_SECONDS, 6, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_EPSIDEAL, 20, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_EPSMAX, 22, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_PACKETS, 40, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_DIRECT, 60, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_EPM, 180, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_SETBACKAGE, 40, 1091);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_ACTIONS, "cancel vl>10 log:morepackets:0:2:if cancel vl>100 log:morepackets:0:2:if cancel cmd:kickpackets", 785);
|
||||
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_EPM, 120, 1154);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_SETBACKAGE, 70, 1154); // 40
|
||||
set(ConfPaths.MOVING_MOREPACKETS_ACTIONS, "cancel vl>2 cancel log:morepackets:10:9:i vl>100 cancel log:morepackets:0:2:ifc cmdc:kickpackets:2:10", 1154);
|
||||
// NoFall
|
||||
set(ConfPaths.MOVING_NOFALL_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_NOFALL_DEALDAMAGE, true, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_SKIPALLOWFLIGHT, true, 785);
|
||||
@@ -510,37 +520,44 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_NOFALL_RESETONTP, false, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_RESETONVEHICLE, true, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_ANTICRITICALS, true, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_ACTIONS, "log:nofall:0:5:if cancel vl>30 log:nofall:0:5:icf cancel", 785);
|
||||
|
||||
set(ConfPaths.MOVING_NOFALL_ACTIONS, "cancel vl>2 cancel log:nofall:0:5:if", 1154); //vl>6 cancel log:nofall:0:1:if cmdc:kickfly:0:5", 1154);
|
||||
// Passable
|
||||
set(ConfPaths.MOVING_PASSABLE_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_ACTIONS, "cancel vl>10 log:passable:0:5:if cancel vl>50 log:passable:0:5:icf cancel", 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_ACTIONS, "cancel vl>15 cancel log:passable:7:9:i vl>100 cancel log:passable:1:4:if cmd:clearpassable:3:15", 1154);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_TELEPORT_ACTIVE, true, 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_ACTIVE, true, 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_TRYTELEPORT, true, 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_PREFIXES, Arrays.asList("sethome", "home set", "setwarp", "warp set", "setback", "set back", "back set"), 785);
|
||||
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_PREFIXES, Arrays.asList("sethome", "home set", "setwarp", "warp set", "setback", "set back", "back set", "warp", "home", "tp" ), 1154);
|
||||
// SurvivalFly
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_STEPHEIGHT, "default", 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_HBUFMAX, 1.0, 1143);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_HBUFMAX, 0.5, 1154);
|
||||
// SurvivalFly ViolationFrequencyHook
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_ACTIVE, true, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_DEBUG, false, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MAXTOTALVLS, 35, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MINADDEDVLS, 5, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MOREVLS, 5, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MOVECOUNT, 10, 1154);
|
||||
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_FREEZECOUNT, 40, 1144);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_FREEZEINAIR, true, 1143);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_ACTIONS,
|
||||
"log:flyfile:3:10:f cancel"
|
||||
+ " vl>100 log:flyshort:0:10:i log:flyfile:0:10:f cancel"
|
||||
+ " vl>400 log:flylong:0:5:i log:flyfile:0:5:cf cancel"
|
||||
+ " vl>1500 log:flylong:0:5:i log:flyfile:0:5:cf cancel cmd:kickfly"
|
||||
, 1080);
|
||||
|
||||
// sf / hover check.
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID, false, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, "cancel log:flyfile:6:15:f"
|
||||
+ " vl>50 cancel log:survivalfly:13:9:i log:flyfile:6:15:f"
|
||||
+ " vl>300 cancel log:survivalfly:7:8:i log:flyfile:1:3:f"
|
||||
+ " vl>830 cancel log:survivalflyhighvl:4:9:i log:flyfile:2:3:f"
|
||||
+ " vl>1500 cancel log:survivalflyhighvl:3:4:i log:flyfile:1:2:f"
|
||||
+ " vl>2100 cancel log:survivalflyhighvl:0:4:icf cmdc:kickfly:0:15 cmd:clearsf:0:15", 1154);
|
||||
// SurvivalFly - Hover Subcheck
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_CHECK, true, 785); // Not a check type yet.
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_STEP, 5, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_TICKS, 85, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_LOGINTICKS, 60, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_FALLDAMAGE, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION, 500, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION, 200, 1154); // Old VL: 500
|
||||
|
||||
// Moving Trace
|
||||
//set(ConfPaths.MOVING_TRACE_MAXAGE, 200, 785); // Your grandma reads code.
|
||||
@@ -571,57 +588,56 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_VEHICLE_SCHEDULESETBACKS, "default", 785);
|
||||
|
||||
set(ConfPaths.MOVING_VEHICLE_MOREPACKETS_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_MOREPACKETS_ACTIONS, "cancel vl>10 log:morepackets:0:2:if cancel", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_MOREPACKETS_ACTIONS, "cancel vl>2 log:morepackets:2:5:if cancel vl>100 cancel log:morepackets:1:2:if cmdc:kickpackets:2:10", 1154);
|
||||
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_ACTIVE, "default", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_HSPEEDCAP + ".default", 0.9, 1154);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_HSPEEDCAP + ".pig", 0.3, 1154);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_ACTIONS, "cancel vl>100 cancel log:vehicleenvelope:0:15:icf", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_ACTIONS, "cancel vl>50 cancel log:vehicleenvelope:10:6:if vl>300 cancel log:vehicleenvelope:0:10:icf cmdc:kickvehiclefly:0:10 cmd:clearvehicle:0:15", 1154);
|
||||
|
||||
// Messages
|
||||
set(ConfPaths.MOVING_MESSAGE_ILLEGALPLAYERMOVE, "Illegal move.", 785);
|
||||
set(ConfPaths.MOVING_MESSAGE_ILLEGALVEHICLEMOVE, "Illegal vehicle move.", 785);
|
||||
|
||||
|
||||
// NET
|
||||
/* Net */
|
||||
|
||||
set(ConfPaths.NET_ACTIVE, "default", 1144);
|
||||
|
||||
// AttackFrequency
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_HALF, 10, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_ONE, 15, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_HALF, 8, 1154); // 10
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_ONE, 15, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_TWO, 30, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_FOUR, 60, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_EIGHT, 100, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_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_ATTACKFREQUENCY_SECONDS_EIGHT, 95, 1154); //100
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_IMPROBABLE_WEIGHT, 3.0, 1154);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_ACTIONS, "cancel vl>10 cancel log:attackfrequency:4:5:i vl>200 cancel log:attackfrequency:0:4:if cmdc:kickattackfrequency", 1154);
|
||||
|
||||
// FlyingFrequency
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_SECONDS, 5, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_PACKETSPERSECOND, 60, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_ACTIONS, "cancel", 785); // TODO: Log actions.
|
||||
// Observed: when a flying packet gets canceled, the position of the player won't get updated to the server
|
||||
// but they will still be able to move client-side; this will result in a server-sided freeze.
|
||||
// When the player thaws out of this state, (presumably) their position will update in a rather fast sequence, which SurvivalFly
|
||||
// really seems to dislike. (Players can sometimes reach 1000+ VLs(!))
|
||||
// Thus, lower Flyingfrequency violation should not be immediately canceled, 20 seems a reasonable threshold through testing.
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_ACTIONS, "vl>20 cancel log:flyingfrequency:3:2:i vl>500 cancel log:flyingfrequency:0:5:if vl>1000 cancel log:flyingfrequency:0:2:icf cmdc:kickflyingfrequency:0:10", 1154);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_ACTIVE, true, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_SECONDS, 3, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_ACTIONS, "cancel", 785); // TODO: Log actions.
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_ACTIONS, "cancel", 785);
|
||||
|
||||
// KeepAliveFrequency
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_SECONDS, 20, 1153);
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_ACTIONS, "cancel vl>10 cancel log:keepalive:0:10:if vl>40 cancel log:keepalive:0:10:icf vl>100 cancel log:keepalive:0:10:icf cmd:kickalive", 785);
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_ACTIONS, "cancel vl>10 cancel log:keepalive:2:6:i vl>60 cancel log:keepalive:0:10:icf cmdc:kickalive", 1154);
|
||||
|
||||
// PacketFrequency (pre 1.9).
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_PPS, 200, 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_PPS, 300, 1154); // Old limit: 200, legit 1.8 clients seem to be able to reach such value more often than not...
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_SECONDS, 4, 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_ACTIONS, "cancel cmd:kickpacketfrequency", 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_ACTIONS, "cancel vl>2 cancel cmdc:kickpacketfrequency", 1154);
|
||||
|
||||
// SoundDistance
|
||||
set(ConfPaths.NET_SOUNDDISTANCE_ACTIVE, "default", 785);
|
||||
@@ -629,89 +645,113 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
// Superseded
|
||||
set(ConfPaths.NET_SUPERSEDED_FLYING_CANCELWAITING, true, 1090);
|
||||
|
||||
set(ConfPaths.NET_WRONGTURN_ACTIVE, "default", 1154);
|
||||
set(ConfPaths.NET_WRONGTURN_ACTIONS, "cancel cmdc:kickillegalrotations:0:10 log:wrongturn:0:15:i", 1154);
|
||||
|
||||
|
||||
// TODO: An extra file might suit these.
|
||||
final String start = "[player] failed [check]: ";
|
||||
final String end = ". VL [violations].";
|
||||
final String tell = "ncp tell [player] ";
|
||||
set(ConfPaths.STRINGS + ".angle", start + "tried to hit multiple entities at the same time (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);
|
||||
set(ConfPaths.STRINGS + ".bautosign", start + "failed autosign with [tags]" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bbfrequency", start + "tried to break too many blocks within time frame" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bdirection", start + "tried to interact with a block out of their line of sight" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bedleave", start + "sends bed leave packets (was not in bed)" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bpspeed", start + "tried to throw projectiles too quickly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".breach", start + "exceeds block-interact distance ([reachdistance])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bspeed", start + "interacts too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bvisible", start + "interacts with a block out of sight" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bwrong", start + "broke another block than clicked" + end, 785);
|
||||
final String start = "&c[player]&7 failed &c[check]&7: ";
|
||||
final String end = " &7(&cVL[violations]&7)";
|
||||
final String tell = "ncp tell [player] &c&l(!)&7 ";
|
||||
final String clear = "ncp delay delay=2 ncp removeplayer [player] ";
|
||||
final String kick = "ncp kick [player] &c&l(!)&7 ";
|
||||
set(ConfPaths.STRINGS + ".against", start + "tried to place a block against liquid blocks or air as if they were solid" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".angle", start + "potentially tried to hit multiple entities at the same time (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".attackfrequency", start + "seems to be using an autoclicker (Clicks: &6[packets]&7/LimitPerTime-frame:&7[limit]&7, &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bautosign", start + "tried to use the autosign hack (Subcheck: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bbfrequency", start + "tried to break too many blocks at once" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bdirection", start + "tried to interact with a block out of their line of sight" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bedleave", start + "tried to send fake bed leave packets (was not in/near a bed)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bpspeed", start + "tried to throw projectiles too quickly" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".breach", start + "tried to interact with a block too far away" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bspeed", start + "is interacting with blocks beyond legit speeds" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bvisible", start + "tried to interact with a block through a solid obstacle" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bwrong", start + "tried to break another block than interacted with last" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".captcha", "[player] failed captcha repeatedly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".chatnormal", start + "potentially annoying chat" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".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 + ".critical", start + "tried to do a critical hit but wasn't technically jumping [tags]" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".chatfast", start + "acted like spamming (message deleted) (IP: &6[ip]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".chatnormal", start + "seems to be spamming the server chat" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".commands", start + "issued too many commands too quickly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".creativefly", start + "tried to move unexpectedly while in air (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".critical", start + "tried to perform an illegal critical hit (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".drop", start + "tried to drop more items than allowed" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".dropkick", "ncp delay ncp kick [player] Dropping items too fast.", 785);
|
||||
set(ConfPaths.STRINGS + ".fastbreak", start + "tried to break blocks ([blocktype]) faster than possible" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".dropkick", kick + "Dropping items too fast.", 1154);
|
||||
set(ConfPaths.STRINGS + ".fastbreak", start + "tried to break a block faster than possible (Block: &6[blocktype]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fastclick", start + "tried to move items in their inventory too quickly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastconsume", start + "consumes [food] [tags] too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastheal", start + "regenerates health faster than usual (health [health])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastplace", start + "tried to place too many blocks" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fdirection", start + "tried to hit an entity out of line of sight" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fightsync", start + "client and server fight data out of sync" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".flyshort", start + "tried to move unexpectedly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".flylong", start
|
||||
+ "tried to move: [locationfrom] -> [locationto], d=[distance] ([tags])" + end, 1067);
|
||||
set(ConfPaths.STRINGS + ".flyfile", start
|
||||
+ "tried to move: [locationfrom] -> [locationto], d=[distance] ([tags])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".freach", start + "tried to attack entity out of reach" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fselfhit", start + "tried to self-hit" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fspeed", start + "tried to attack with too high a frequency" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastconsume", start + "tried to consume an item too quickly (Food: &6[food][tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fastheal", start + "tried to regenerate their health bar faster than possible (Health: &6health]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fastplace", start + "tried to place blocks too quickly" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fdirection", start + "tried to hit an entity outside their line of sight" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fdirectionlowvl", start + "could be using an aimbot (hit not canceled)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".flyfile", start + "tried to perform an illegal move from ([locationfrom]) to ([locationto]) over a distance of ([distance]) blocks, subchecks triggered> ([tags])" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".flyingfrequency", start + "is manipulating packets sent to the server to gain an unfair advantage" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".freach", start + "tried to hit an entity from a suspicious distance" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fselfhit", start + "tried to hit themselves" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fspeed", start + "clicked [violations] times over the established CPS limit" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".godmode", start + "tried to ignore inflicted damage (Health: &7[health]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".gutenberg", start + "created a book with too many pages" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".godmode", start + "avoided taking damage or lagging (health [health])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".improbable", start + "meets the improbable more than expected" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".instantbow", start + "fires bow too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".instanteat", start + "eats food [food] too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".inventorymove", start + "interacted with inventory while it was not possible (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);
|
||||
set(ConfPaths.STRINGS + ".kickattackfrequency", "ncp kick [player] Unlikely fast clicking.", 785);
|
||||
set(ConfPaths.STRINGS + ".kickbedleave", "ncp delay ncp kick [player] Go find a bed!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickbspeed", "ncp kick [player] You interacted too fast!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickcaptcha", "ncp kick [player] Enter the captcha!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchat1", "ncp tempkick [player] 1 You're still not allowed to spam!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchat5", "ncp tempkick [player] 5 You're not intended to spam!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchatfast", "ncp kick [player] You're not allowed to spam in chat!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchatnormal", "ncp kick [player] Too many chat messages, take a break.", 785);
|
||||
set(ConfPaths.STRINGS + ".kickcommands", "ncp tempkick [player] 1 You're not allowed to spam commands!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickfly", "ncp delay ncp kick [player] Kicked for flying (or related)", 785);
|
||||
set(ConfPaths.STRINGS + ".kickfrequency", "ncp kick [player] You did something too fast!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickgod", "ncp kick [player] God mode?", 785);
|
||||
set(ConfPaths.STRINGS + ".kickinvaliddata", "ncp kick [player] Invalid data.", 785);
|
||||
set(ConfPaths.STRINGS + ".kickpacketfrequency", "ncp kick [player] Too many packets.", 785); // TODO
|
||||
set(ConfPaths.STRINGS + ".kickpackets", "ncp delay ncp kick [player] Too many packets (extreme lag?)", 785);
|
||||
set(ConfPaths.STRINGS + ".kickselfhit", "ncp kick [player] You tried to hit yourself!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickwb", "ncp kick [player] Block breaking out of sync!", 785);
|
||||
set(ConfPaths.STRINGS + ".kick_wrongturn", "ncp kick [player] Wrong turn!", 1143);
|
||||
set(ConfPaths.STRINGS + ".log_wrongturn", start + "looked wrongly" + end, 1143);
|
||||
set(ConfPaths.STRINGS + ".morepackets", start + "sent too many moves ([packets] [tags])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".improbable", start + "is exhibiting an erratic behaviour (Check: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".instantbow", start + "tried to shoot an arrow too fast" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".instanteat", start + "tried to consume an item too quickly (Food: &6[food]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".inventorymove", start + "tried to click in their inventory while simultaneously performing another action (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".keepalive", start + "is spamming keep-alive packets to the server" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".kickagainst", kick + "Invalid block placements.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickalive", kick + "Too many keep-alive packets.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickattackfrequency", kick + "Unlikely fast clicking.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickbedleave", kick + "Invalid bed-leave packets.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickbow", kick + "Shooting arrows too quickly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickbspeed", kick + "Too fast block interactions.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickcaptcha", kick + "Enter the captcha!", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchat1", "ncp tempkick [player] 1 &c&l(!)&7 Do not spam the server chat (1 minute tempkick)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchat5", "ncp tempkick [player] 5 &c&l(!)&7 You are not allowed to spam the server chat (5 minutes tempkick)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchatfast", kick + "Stop spamming.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchatnormal", kick + "Too many chat messages, take a break.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickcommands", "ncp tempkick [player] 1 &c&l(!)&7 Do not spam commands (1 minute tempkick)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastbreak", kick + "Breaking blocks too fast.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastclick", kick + "Unlikely inventory interactions.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastconsume", kick + "Using items too quickly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastheal", kick + "Too fast health regeneration.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastplace", kick + "Placing blocks too quickly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfly", kick + "Moved unexpectedly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickflyingfrequency", kick + "Kicked for packet spam.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfrequency", kick + "Illegal block-breaking frequency.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickgod", kick + "GodMode?", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickillegalblockinteract", kick + "Illegal block interactions.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickillegalrotations", kick + "Invalid rotations.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickimprobable", kick + "Illegal client modifications.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickinvaliddata", kick + "Invalid book data.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickpacketfrequency", kick + "Too many packets.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickpackets", kick + "You sent too many moves (extreme lag?)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickscaffold", kick + "Incorrect block placements.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickselfhit", kick + "You tried to hit yourself!", 1154);
|
||||
set(ConfPaths.STRINGS + ".kicksuspiciouscombat", kick + "Illegal combat modifications.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickvehiclefly", kick + "Unexpected vehicle movement.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickwb", kick + "Block breaking out of sync.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kreach", start + "is most likely using a killaura cheat" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".morepackets", start + "sent too many moves (&cPackets&7/&cVL [packets]&7)", 1154);
|
||||
set(ConfPaths.STRINGS + ".msgtempdenylogin", "You are temporarily denied to join this server.", 785);
|
||||
set(ConfPaths.STRINGS + ".munchhausen", start + "almost made it off the pit" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".nofall", start + "tried to alter fall damage ([tags])" + end, 1057);
|
||||
set(ConfPaths.STRINGS + ".chatfast", start + "acted like spamming (IP: [ip])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".noswing", start + "didn't swing arm" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".passable", start + "moved into a block ([blocktype]) from [locationfrom] to [locationto] distance [distance] " + end, 785);
|
||||
set(ConfPaths.STRINGS + ".relog", start + "relogs too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".scaffold", start + "placed against a block face they did not interact with" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".tellchatnormal", tell + "&cNCP: &eToo many messages, slow down...", 785);
|
||||
set(ConfPaths.STRINGS + ".tempkick1", "ncp tempkick [player] 1 Wait a minute!", 785);
|
||||
set(ConfPaths.STRINGS + ".tempkick5", "ncp tempkick [player] 5 You have five minutes to think about it!", 785);
|
||||
set(ConfPaths.STRINGS + ".vehicleenvelope", start + "moved a vehicle too fast ([tags])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".munchhausen", start + "tried to hit themeselves with a fishing rod too many times (the knockback can be potentially abused for bypasses)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".nofall", start + "tried to alter fall damage or fall distance (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".noswing", start + "didn't swing arm before performing their action" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".passable", start + "tried to move into a block (bugged player of phase cheat)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".pitchpattern", start + "has pitch rotation patterns that are often associated with cheats" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".relog", start + "tried to relog too fast" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".scaffold", start + "tried to place a block in an unnatural way (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".survivalfly", start + "tried to move unexpectedly" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".survivalflyhighvl", start + "tried to perform an illegal move (Subchecks: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".tellchatnormal", tell + "Too many messages, slow down...", 1154);
|
||||
set(ConfPaths.STRINGS + ".tempkick1", "ncp tempkick [player] 1 &c&l(!)&7 You have to wait 1 minute before joining this server again.", 1154);
|
||||
set(ConfPaths.STRINGS + ".tempkick5", "ncp tempkick [player] 5 &c&l(!)&7 You have to wait 5 minutes before joining this server again.", 1154);
|
||||
set(ConfPaths.STRINGS + ".vehicleenvelope", start + "tried to move a vehicle unexpectedly (Tags/Vehicle: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".wrongturn", start + "sent an impossible pitch rotation (&6>90 &7or&6 <-90&7)" + end, 1154);
|
||||
// Clear a check data
|
||||
set(ConfPaths.STRINGS + ".clearimprobable", clear + "COMBINED_IMPROBABLE", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearsf", clear + "MOVING_SURVIVALFLY", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearcf", clear + "MOVING_CREATIVEFLY", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearpassable", clear + "MOVING_PASSABLE", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearvehicle", clear + "MOVING_VEHICLE_ENVELOPE", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearcritical", clear + "FIGHT_CRITICAL", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearscaffold", clear + "BLOCKPLACE_SCAFFOLD", 1154);
|
||||
|
||||
// Compatibility settings.
|
||||
set(ConfPaths.COMPATIBILITY_EXEMPTIONS_WILDCARD_DEFAULT_METADATA_ACTIVE, true, 785);
|
||||
@@ -734,6 +774,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + name, "default+ign_passable+ground_height", 785);
|
||||
}
|
||||
// TODO: proper model for these blocks
|
||||
for (final String DeadCoralType : Arrays.asList(
|
||||
"DEAD_TUBE",
|
||||
"DEAD_BRAIN",
|
||||
@@ -741,8 +782,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
"DEAD_FIRE",
|
||||
"DEAD_HORN"
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL_WALL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL_WALL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
}
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "DEAD_TUBE_CORAL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "DEAD_BRAIN_CORAL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
@@ -755,4 +796,4 @@ public class DefaultConfig extends ConfigFile {
|
||||
// // Update internal factory based on all the new entries to the "actions" section.
|
||||
// setActionFactory();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,6 +113,7 @@ public class Permissions {
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST = add(BLOCKPLACE + ".against");
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST_AIR = add(BLOCKPLACE_AGAINST + ".air");
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST_LIQUIDS = add(BLOCKPLACE_AGAINST + ".liquids");
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST_SELF = add(BLOCKPLACE_AGAINST + ".self");
|
||||
public static final RegisteredPermission BLOCKPLACE_AUTOSIGN = add(BLOCKPLACE + ".autosign");
|
||||
public static final RegisteredPermission BLOCKPLACE_BOATSANYWHERE = add(BLOCKPLACE + ".boatsanywhere");
|
||||
public static final RegisteredPermission BLOCKPLACE_DIRECTION = add(BLOCKPLACE + ".direction");
|
||||
@@ -152,7 +153,8 @@ public class Permissions {
|
||||
public static final RegisteredPermission INVENTORY_GUTENBERG = add(INVENTORY + ".gutenberg");
|
||||
public static final RegisteredPermission INVENTORY_INSTANTBOW = add(INVENTORY + ".instantbow");
|
||||
public static final RegisteredPermission INVENTORY_INSTANTEAT = add(INVENTORY + ".instanteat");
|
||||
public static final RegisteredPermission INVENTORY_MOVE = add(INVENTORY + ".inventorymove");
|
||||
public static final RegisteredPermission INVENTORY_INVENTORYMOVE = add(INVENTORY + ".inventorymove");
|
||||
public static final RegisteredPermission INVENTORY_MOREINVENTORY = add(INVENTORY + ".moreinventory");
|
||||
public static final RegisteredPermission INVENTORY_ITEMS = add(INVENTORY + ".items");
|
||||
public static final RegisteredPermission INVENTORY_OPEN = add(INVENTORY + ".open");
|
||||
|
||||
@@ -161,6 +163,7 @@ public class Permissions {
|
||||
public static final RegisteredPermission NET_FLYINGFREQUENCY = add(NET + ".flyingfrequency");
|
||||
public static final RegisteredPermission NET_KEEPALIVEFREQUENCY = add(NET + ".keepalivefrequency");
|
||||
public static final RegisteredPermission NET_PACKETFREQUENCY = add(NET + ".packetfrequency");
|
||||
public static final RegisteredPermission NET_WRONGTURN = add(NET + ".wrongturn");
|
||||
|
||||
public static final RegisteredPermission MOVING = add(CHECKS + ".moving");
|
||||
public static final RegisteredPermission MOVING_CREATIVEFLY = add(MOVING + ".creativefly");
|
||||
@@ -172,6 +175,7 @@ public class Permissions {
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_SNEAKING = add(MOVING_SURVIVALFLY + ".sneaking");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_SPEEDING = add(MOVING_SURVIVALFLY + ".speeding");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_SPRINTING = add(MOVING_SURVIVALFLY + ".sprinting");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_WATERWALK = add(MOVING_SURVIVALFLY + ".waterwalk");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_STEP = add(MOVING_SURVIVALFLY + ".step");
|
||||
public static final RegisteredPermission MOVING_VEHICLE = add(MOVING + ".vehicle");
|
||||
public static final RegisteredPermission MOVING_VEHICLE_MOREPACKETS = add(MOVING_VEHICLE + ".morepackets");
|
||||
@@ -229,4 +233,4 @@ public class Permissions {
|
||||
return new ArrayList<RegisteredPermission>(permissions.values());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1
-21
@@ -267,26 +267,6 @@ public abstract class AxisTracing implements ICollideBlocks, ISetMargins {
|
||||
return;
|
||||
}
|
||||
final boolean checkInitiallyColliding = shouldCheckForIgnoredBlocks();
|
||||
if (increment == -1) {
|
||||
final double dis = Math.abs(yIn - this.y1);
|
||||
for (int x = iMinX; x <= iMaxX; x++) {
|
||||
for (int z = iMinZ; z <= iMaxZ; z++) {
|
||||
if (dis >= 0.1217 && !step(x, y, z, xMin, increment == 1 ? yStart : yEnd, zMin, xMax, increment == 1 ? yEnd : yStart, zMax, Axis.Y_AXIS, increment)) {
|
||||
if (step(x, y - 1, z, xMin, yEnd, zMin, xMax, yStart -0.7, zMax, Axis.Y_AXIS, increment)) {
|
||||
collides = false;
|
||||
return;
|
||||
} else {
|
||||
if (checkInitiallyColliding && isBlockIgnored(x, y, z) && isBlockIgnored(x, y-1, z)) {
|
||||
// Ignore.
|
||||
} else {
|
||||
collides = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int x = iMinX; x <= iMaxX; x++) {
|
||||
for (int z = iMinZ; z <= iMaxZ; z++) {
|
||||
if (checkInitiallyColliding && isBlockIgnored(x, y, z)) {
|
||||
@@ -458,4 +438,4 @@ public abstract class AxisTracing implements ICollideBlocks, ISetMargins {
|
||||
double minX, double minY, double minZ, double maxX, double maxY, double maxZ,
|
||||
Axis axis, int increment);
|
||||
|
||||
}
|
||||
}
|
||||
+21
-7
@@ -14,8 +14,12 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.utilities.collision;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@@ -196,9 +200,9 @@ public class CollisionUtil {
|
||||
* the angle precision
|
||||
* @return the double
|
||||
*/
|
||||
public static double combinedDirectionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double precision, final double anglePrecision)
|
||||
public static double combinedDirectionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double precision, final double anglePrecision, boolean isPlayer)
|
||||
{
|
||||
return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), targetX, targetY, targetZ, targetWidth, targetHeight, precision, anglePrecision);
|
||||
return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), targetX, targetY, targetZ, targetWidth, targetHeight, precision, anglePrecision, isPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,7 +224,7 @@ public class CollisionUtil {
|
||||
*/
|
||||
public static double combinedDirectionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final Block target, final double precision, final double anglePrecision)
|
||||
{
|
||||
return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), target.getX(), target.getY(), target.getZ(), 1, 1, precision, anglePrecision);
|
||||
return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), target.getX(), target.getY(), target.getZ(), 1, 1, precision, anglePrecision, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,7 +259,7 @@ public class CollisionUtil {
|
||||
* Precision in grad.
|
||||
* @return the double
|
||||
*/
|
||||
public static double combinedDirectionCheck(final double sourceX, final double sourceY, final double sourceZ, final double dirX, final double dirY, final double dirZ, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double blockPrecision, final double anglePrecision)
|
||||
public static double combinedDirectionCheck(final double sourceX, final double sourceY, final double sourceZ, final double dirX, final double dirY, final double dirZ, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double blockPrecision, final double anglePrecision, final boolean isPlayer)
|
||||
{
|
||||
double dirLength = Math.sqrt(dirX * dirX + dirY * dirY + dirZ * dirZ);
|
||||
if (dirLength == 0.0) dirLength = 1.0; // ...
|
||||
@@ -265,9 +269,10 @@ public class CollisionUtil {
|
||||
final double dZ = targetZ - sourceZ;
|
||||
|
||||
final double targetDist = Math.sqrt(dX * dX + dY * dY + dZ * dZ);
|
||||
final double minDist = isPlayer ? Math.max(targetHeight, targetWidth) / 2.0 : Math.max(targetHeight, targetWidth);
|
||||
|
||||
if (targetDist > Math.max(targetHeight, targetWidth) / 2.0 && TrigUtil.angle(sourceX, sourceY, sourceZ, dirX, dirY, dirZ, targetX, targetY, targetZ) * TrigUtil.fRadToGrad > anglePrecision){
|
||||
return targetDist - Math.max(targetHeight, targetWidth) / 2.0;
|
||||
if (targetDist > minDist && TrigUtil.angle(sourceX, sourceY, sourceZ, dirX, dirY, dirZ, targetX, targetY, targetZ) * TrigUtil.fRadToGrad > anglePrecision){
|
||||
return targetDist - minDist;
|
||||
}
|
||||
|
||||
final double xPrediction = targetDist * dirX / dirLength;
|
||||
@@ -474,5 +479,14 @@ public class CollisionUtil {
|
||||
public static double axisDistance(final double pos, final double minPos, final double maxPos) {
|
||||
return pos < minPos ? Math.abs(pos - minPos) : (pos > maxPos ? Math.abs(pos - maxPos) : 0.0);
|
||||
}
|
||||
|
||||
public static boolean isCollidingWithEntities(final Player p, final boolean onlylivingenitites) {
|
||||
if (onlylivingenitites) {
|
||||
List<Entity> entities = p.getNearbyEntities(0.15, 0.2, 0.15);
|
||||
entities.removeIf(e -> !(e instanceof LivingEntity));
|
||||
return !entities.isEmpty();
|
||||
}
|
||||
return !p.getNearbyEntities(0.15, 0.15, 0.15).isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -244,6 +244,16 @@ public class LocUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Quick out of bounds check for yaw (-360 < yaw < 360).
|
||||
*
|
||||
* @param yaw
|
||||
* @return
|
||||
*/
|
||||
public static final boolean needsYawCorrection2(final float yaw) {
|
||||
return Float.isNaN(yaw) || yaw <= -360f || yaw >= 360f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quick out of bounds check for yaw.
|
||||
*
|
||||
@@ -308,6 +318,17 @@ public class LocUtil {
|
||||
return needsYawCorrection(yaw) || needsPitchCorrection(pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Quick out of bounds check for yaw and pitch.
|
||||
*
|
||||
* @param yaw
|
||||
* @param pitch
|
||||
* @return
|
||||
*/
|
||||
public static final boolean needsDirectionCorrection2(final float yaw, final float pitch) {
|
||||
return needsYawCorrection2(yaw) || needsPitchCorrection(pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure 0 <= yaw < 360.
|
||||
*
|
||||
@@ -339,6 +360,25 @@ public class LocUtil {
|
||||
return yaw;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure -360 < yaw < 360.
|
||||
*
|
||||
* @param yaw
|
||||
* @return
|
||||
*/
|
||||
public static final float correctYaw2(float yaw) {
|
||||
if (Float.isNaN(yaw) || yaw == Float.NEGATIVE_INFINITY || yaw == Float.POSITIVE_INFINITY) {
|
||||
return 0f;
|
||||
}
|
||||
if (yaw >= 360f) {
|
||||
yaw -= 360f * Math.floor(yaw / 360f);
|
||||
}
|
||||
if (yaw <= -360f) {
|
||||
yaw -= 360f * Math.ceil(yaw / 360f);
|
||||
}
|
||||
return yaw;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure -90 <= pitch <= 90.
|
||||
*
|
||||
|
||||
+28
-23
@@ -534,10 +534,10 @@ public class BlockProperties {
|
||||
public static long[] glassTimes = secToMs(0.45);
|
||||
|
||||
/** The Constant gravelTimes. */
|
||||
public static final long[] gravelTimes = secToMs(0.9, 0.45, 0.25, 0.15, 0.15, 0.1);
|
||||
public static final long[] gravelTimes = secToMs(0.85, 0.4, 0.21, 0.1, 0.1, 0.075);
|
||||
|
||||
/** The rails times. */
|
||||
public static long[] railsTimes = secToMs(1.05, 0.55, 0.3, 0.2, 0.15, 0.1);
|
||||
public static long[] railsTimes = secToMs(1.05, 0.505, 0.25, 0.15, 0.1, 0.05);
|
||||
|
||||
/** The Constant woodTimes. */
|
||||
public static final long[] woodTimes = secToMs(3, 1.5, 0.75, 0.5, 0.4, 0.25);
|
||||
@@ -554,7 +554,7 @@ public class BlockProperties {
|
||||
/** The Constant gravelType. */
|
||||
public static final BlockProps gravelType = new BlockProps(woodSpade, 0.6f, gravelTimes);
|
||||
/** Stone type blocks. */
|
||||
public static final BlockProps stoneType = new BlockProps(woodPickaxe, 1.5f);
|
||||
public static final BlockProps stoneType = new BlockProps(woodPickaxe, 1.45f, secToMs(7.5, 1.1, 0.55, 0.35, 0.25, 0.15));
|
||||
|
||||
/** The Constant woodType. */
|
||||
public static final BlockProps woodType = new BlockProps(woodAxe, 2, woodTimes);
|
||||
@@ -676,7 +676,6 @@ public class BlockProperties {
|
||||
public static final long F_CLIMBABLE = f_flag();
|
||||
/** Allow climbable can climb up but they didn't use to like vine. */
|
||||
public static final long F_CLIMBUPABLE = f_flag();
|
||||
public static final long F_CLIMBLIQ = f_flag();
|
||||
/** The block can change shape. This is most likely not 100% accurate... */
|
||||
public static final long F_VARIABLE = f_flag();
|
||||
// /** The block has full bounds (0..1), inaccurate! */
|
||||
@@ -743,6 +742,9 @@ public class BlockProperties {
|
||||
// TODO: Separate no fall damage flag ? [-> on ground could return "dominating" flags, or extra flags]
|
||||
/** Like slime block: bounce back 25% of fall height without taking fall damage [TODO: Check/adjust]. */
|
||||
public static final long F_BOUNCE25 = f_flag();
|
||||
|
||||
/** HONEY_BLOCK */
|
||||
public static final long F_STICKY = f_flag();
|
||||
|
||||
/**
|
||||
* The facing direction is described by the lower 3 data bits in order of
|
||||
@@ -842,6 +844,7 @@ public class BlockProperties {
|
||||
|
||||
/** Cobweb like blocks (adhesive). */
|
||||
public static final long F_COBWEB = f_flag();
|
||||
public static final long F_COBWEB2 = f_flag();
|
||||
public static final long F_SOULSAND = f_flag();
|
||||
|
||||
/**
|
||||
@@ -857,6 +860,9 @@ public class BlockProperties {
|
||||
|
||||
/** Height 15/16 (0.9375 = 1 - 0.0625). */
|
||||
public static final long F_HEIGHT16_15 = f_flag();
|
||||
|
||||
/** Flag for all slabs to fix issue when jumping on "stairs" of slabs, flagging for hackStep. */
|
||||
public static final long F_SLAB = f_flag();
|
||||
|
||||
// TODO: Convenience constants combining all height / minheight flags.
|
||||
|
||||
@@ -1059,7 +1065,7 @@ public class BlockProperties {
|
||||
}
|
||||
|
||||
// Step (ground + full width).
|
||||
final long stepFlags = F_GROUND | F_XZ100;
|
||||
final long stepFlags = F_GROUND | F_XZ100 | F_SLAB;
|
||||
for (final Material mat : new Material[]{
|
||||
BridgeMaterial.STONE_SLAB,
|
||||
}) {
|
||||
@@ -1069,7 +1075,7 @@ public class BlockProperties {
|
||||
setFlag(mat, stepFlags);
|
||||
}
|
||||
for (final Material mat : MaterialUtil.NEWLIQ) {
|
||||
setFlag(mat, F_XZ100 | F_CLIMBABLE | F_CLIMBLIQ);
|
||||
setFlag(mat, F_XZ100 | F_NEWLIQ | F_LIQUID | F_WATER);
|
||||
}
|
||||
|
||||
// Rails
|
||||
@@ -1141,17 +1147,14 @@ public class BlockProperties {
|
||||
setFlag(Material.ICE, F_ICE);
|
||||
|
||||
// Not ground (!).
|
||||
for (final Material mat : new Material[]{
|
||||
BridgeMaterial.SIGN,
|
||||
}) {
|
||||
// TODO: Might keep solid since it is meant to be related to block shapes rather ("original mc value").
|
||||
maskFlag(mat, ~(F_GROUND | F_SOLID));
|
||||
}
|
||||
// TODO: Might keep solid since it is meant to be related to block shapes rather ("original mc value").
|
||||
maskFlag(BridgeMaterial.SIGN, ~(F_GROUND | F_SOLID));
|
||||
|
||||
// Ignore for passable.
|
||||
for (final Material mat : new Material[]{
|
||||
// More strictly needed.
|
||||
BridgeMaterial.STONE_PRESSURE_PLATE,
|
||||
BridgeMaterial.STONE_PRESSURE_PLATE,
|
||||
BridgeMaterial.WOODEN_PRESSURE_PLATE,
|
||||
BridgeMaterial.SIGN,
|
||||
BridgeMaterial.get("DIODE_BLOCK_ON"),
|
||||
BridgeMaterial.get("DIODE_BLOCK_OFF"),
|
||||
@@ -1345,15 +1348,16 @@ public class BlockProperties {
|
||||
setBlock(Material.SOUL_SAND, sandType);
|
||||
for (Material mat: new Material[]{Material.LEVER, BridgeMaterial.PISTON,
|
||||
BridgeMaterial.PISTON_HEAD, BridgeMaterial.STICKY_PISTON,
|
||||
Material.STONE_BUTTON, BridgeMaterial.PISTON}) {
|
||||
BridgeMaterial.PISTON}) {
|
||||
setBlock(mat, leverType);
|
||||
}
|
||||
setBlock(Material.STONE_BUTTON,new BlockProps(woodPickaxe, 0.5f, secToMs(0.7, 0.35, 0.15, 0.1, 0.06, 0.05)));
|
||||
// setBlock(Material.ICE, new BlockProps(woodPickaxe, 0.5f, secToMs(2.5, 0.4, 0.2, 0.15, 0.1, 0.1)));
|
||||
setBlock(Material.ICE, new BlockProps(woodPickaxe, 0.5f, secToMs(0.7, 0.35, 0.18, 0.12, 0.09, 0.06 )));
|
||||
setBlock(Material.DIRT, sandType);
|
||||
setBlock(BridgeMaterial.CAKE, leverType);
|
||||
setBlock(Material.BREWING_STAND, new BlockProps(woodPickaxe, 0.5f, secToMs(2.5, 0.4, 0.2, 0.15, 0.1, 0.1)));
|
||||
setBlock(Material.SPONGE, new BlockProps(noTool, 0.6f, secToMs(0.9)));
|
||||
setBlock(Material.BREWING_STAND, new BlockProps(woodPickaxe, 0.5f, secToMs(2.5, 0.35, 0.175, 0.12, 0.075, 0.05)));
|
||||
setBlock(Material.SPONGE, new BlockProps(noTool, 0.6f, secToMs(0.85)));
|
||||
for (Material mat : new Material[]{
|
||||
BridgeMaterial.MYCELIUM, BridgeMaterial.FARMLAND,
|
||||
Material.GRAVEL, BridgeMaterial.GRASS_BLOCK,
|
||||
@@ -1376,7 +1380,7 @@ public class BlockProperties {
|
||||
Material.STONE, BridgeMaterial.STONE_BRICKS,
|
||||
BridgeMaterial.STONE_BRICK_STAIRS,
|
||||
}) {
|
||||
setBlock(mat, stoneType);
|
||||
setBlock(mat, stoneType);
|
||||
}
|
||||
setBlock(Material.NOTE_BLOCK, new BlockProps(woodAxe, 0.8f, secToMs(1.2, 0.6, 0.3, 0.2, 0.15, 0.1)));
|
||||
final BlockProps pumpkinType = new BlockProps(woodAxe, 1, secToMs(1.5, 0.75, 0.4, 0.25, 0.2, 0.15));
|
||||
@@ -1484,7 +1488,8 @@ public class BlockProperties {
|
||||
setBlock(BridgeMaterial.COBBLESTONE_WALL, brickType);
|
||||
setFlag(BridgeMaterial.COBBLESTONE_WALL, F_HEIGHT150);
|
||||
for (Material mat : MaterialUtil.WOODEN_BUTTONS) {
|
||||
setBlock(mat, leverType);
|
||||
//setBlock(mat, leverType);
|
||||
setBlock(mat,new BlockProps(woodAxe, 0.5f, secToMs(0.7, 0.3, 0.15, 0.1, 0.06, 0.05)));
|
||||
}
|
||||
props = new BlockProps(noTool, 8.5f, secToMs(1.45));
|
||||
for (Material mat : MaterialUtil.HEADS_GROUND) {
|
||||
@@ -2684,7 +2689,7 @@ public class BlockProperties {
|
||||
* @return true, if is liquid
|
||||
*/
|
||||
public static final boolean isNewLiq(final Material blockType) {
|
||||
return (getBlockFlags(blockType) & F_CLIMBLIQ) != 0;
|
||||
return (getBlockFlags(blockType) & F_NEWLIQ) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2866,7 +2871,7 @@ public class BlockProperties {
|
||||
final int data1 = access.getData(x, y, z);
|
||||
// (Trap door may be attached to top or bottom, regardless.)
|
||||
// Trap door must be open (really?).
|
||||
if ((data1 & 0x04) != 0x04) {
|
||||
if (data1 == 0) {
|
||||
return false;
|
||||
}
|
||||
// Need the facing direction.
|
||||
@@ -3179,7 +3184,7 @@ public class BlockProperties {
|
||||
} else if (id.toString().equals("BELL") && (access.getData(bx, by, bz) & 0x4) != 0) {
|
||||
if (Math.max(fy, fy + dY * dT) >0.39 && Math.max(fy, fy + dY * dT) < 0.9) return true;
|
||||
} else if (id.toString().equals("CHORUS_PLANT") && !collidesFence(fx, fz, dX, dZ, dT, 0.3)) return true;
|
||||
else if (id.toString().equals("BAMBOO")) return true;
|
||||
else if (id.toString().equals("BAMBOO")) return true;
|
||||
// Nothing found.
|
||||
return false;
|
||||
}
|
||||
@@ -4917,7 +4922,7 @@ public class BlockProperties {
|
||||
int added = 0;
|
||||
final int iMinX = Location.locToBlock(minX);
|
||||
final int iMaxX = Location.locToBlock(maxX);
|
||||
final int iMinY = Location.locToBlock(minY - 0.5); // Include height150 blocks.
|
||||
final int iMinY = Location.locToBlock(minY); // Include height150 blocks.
|
||||
final int iMaxY = Location.locToBlock(maxY);
|
||||
final int iMinZ = Location.locToBlock(minZ);
|
||||
final int iMaxZ = Location.locToBlock(maxZ);
|
||||
@@ -4963,4 +4968,4 @@ public class BlockProperties {
|
||||
BlockProperties.specialCaseTrapDoorAboveLadder = specialCaseTrapDoorAboveLadder;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -30,7 +30,7 @@ For the plugin/artifact version see the NoCheatPlus module.</description>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -114,6 +114,8 @@ import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager;
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPHookManager;
|
||||
import fr.neatmonster.nocheatplus.hooks.allviolations.AllViolationsConfig;
|
||||
import fr.neatmonster.nocheatplus.hooks.allviolations.AllViolationsHook;
|
||||
import fr.neatmonster.nocheatplus.hooks.violationfrequency.ViolationFrequencyConfig;
|
||||
import fr.neatmonster.nocheatplus.hooks.violationfrequency.ViolationFrequencyHook;
|
||||
import fr.neatmonster.nocheatplus.logging.BukkitLogManager;
|
||||
import fr.neatmonster.nocheatplus.logging.LogManager;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
@@ -233,6 +235,8 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
||||
|
||||
/** Hook for logging all violations. */
|
||||
private final AllViolationsHook allViolationsHook = new AllViolationsHook();
|
||||
|
||||
private final ViolationFrequencyHook vlFrequencyHook = new ViolationFrequencyHook();
|
||||
|
||||
/** Block change tracking (pistons, other). */
|
||||
private final BlockChangeTracker blockChangeTracker = new BlockChangeTracker();
|
||||
@@ -704,6 +708,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
||||
NCPExemptionManager.clear();
|
||||
|
||||
// Remove hooks.
|
||||
vlFrequencyHook.unregister();
|
||||
allViolationsHook.unregister();
|
||||
NCPHookManager.removeAllHooks();
|
||||
|
||||
@@ -1045,6 +1050,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
||||
|
||||
// Setup allViolationsHook
|
||||
allViolationsHook.setConfig(new AllViolationsConfig(config));
|
||||
vlFrequencyHook.setConfig(new ViolationFrequencyConfig(config));
|
||||
|
||||
// if (config.getBoolean(ConfPaths.MISCELLANEOUS_CHECKFORUPDATES)) {
|
||||
// // Is a new update available?
|
||||
@@ -1168,6 +1174,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
||||
// Cache some things. TODO: Where is this comment from !?
|
||||
// Re-setup allViolationsHook.
|
||||
allViolationsHook.setConfig(new AllViolationsConfig(config));
|
||||
vlFrequencyHook.setConfig(new ViolationFrequencyConfig(config));
|
||||
// Set block change tracker.
|
||||
updateBlockChangeTracker(config);
|
||||
}
|
||||
|
||||
+2
-2
@@ -48,9 +48,9 @@ public class DefaultComponentFactory {
|
||||
public DefaultComponentFactory() {
|
||||
for (Activation condition : Arrays.asList(
|
||||
new Activation()
|
||||
.neutralDescription("ProtocolLib 4.5.0 or later for Minecraft 1.14.x")
|
||||
.neutralDescription("ProtocolLib 4.5.0 or later for Minecraft 1.14.x to 1.15.x")
|
||||
.pluginVersionGT("ProtocolLib", "4.5.0", true)
|
||||
.minecraftVersionBetween("1.14", true, "1.15", false)
|
||||
.minecraftVersionBetween("1.14", true, "1.16", false)
|
||||
.advertise(true)
|
||||
,
|
||||
new Activation()
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package fr.neatmonster.nocheatplus.hooks.violationfrequency;
|
||||
|
||||
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
||||
import fr.neatmonster.nocheatplus.config.ConfigFile;
|
||||
|
||||
/**
|
||||
* Configuration for the ViolationFrequencyHook.
|
||||
*
|
||||
* @author xaw3ep
|
||||
*
|
||||
*/
|
||||
|
||||
public class ViolationFrequencyConfig {
|
||||
/** Set this hook active or not */
|
||||
protected final boolean active;
|
||||
|
||||
/** Log whenever more vls is added */
|
||||
protected final boolean debug;
|
||||
|
||||
/** Set the want to add vl to check which generate too small vls */
|
||||
protected final int morevls;
|
||||
|
||||
/** Moves count from last violated move */
|
||||
protected final int movecount;
|
||||
|
||||
/** Minimum vls generated by check not need to add more vls */
|
||||
protected final int minaddedvls;
|
||||
|
||||
/** Maximum total vls to stop active this hook */
|
||||
protected final int maxtotalvls;
|
||||
|
||||
public ViolationFrequencyConfig(ConfigFile config) {
|
||||
active = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_ACTIVE);
|
||||
debug = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_DEBUG);
|
||||
morevls = config.getInt(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MOREVLS);
|
||||
minaddedvls = config.getInt(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MINADDEDVLS);
|
||||
maxtotalvls = config.getInt(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MAXTOTALVLS);
|
||||
movecount = config.getInt(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MOVECOUNT);
|
||||
}
|
||||
//public ViolationFrequencyConfig() {
|
||||
// active = true;
|
||||
// debug = true;
|
||||
// morevls = 5;
|
||||
// minaddedvls = 5;
|
||||
// maxtotalvls = 35;
|
||||
// movecount = 10;
|
||||
//}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package fr.neatmonster.nocheatplus.hooks.violationfrequency;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.access.IViolationInfo;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.hooks.IFirst;
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPHook;
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPHookManager;
|
||||
import fr.neatmonster.nocheatplus.logging.LogManager;
|
||||
import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
|
||||
/**
|
||||
* A simple hook good at preventing false flags on small Vls and help generate larger on checks given out too small vl.
|
||||
*
|
||||
* In default config, it will make NCP won't setback anythings till VL reach to 35,
|
||||
* SurvivalFly actions it will look like: vl>35 cancel ....
|
||||
* But it can catch if they are using shortfly depend on the flag frequency between moves.
|
||||
* Need to set the survivalfly.actions always cancel at vl 0 to make this hook work properly
|
||||
*
|
||||
* @author xaw3ep
|
||||
*
|
||||
*/
|
||||
|
||||
public class ViolationFrequencyHook implements NCPHook, IFirst {
|
||||
private ViolationFrequencyConfig config;
|
||||
private Integer hookId = null;
|
||||
|
||||
public ViolationFrequencyHook() {
|
||||
}
|
||||
|
||||
public void setConfig(ViolationFrequencyConfig config) {
|
||||
this.config = config;
|
||||
if (config == null || !config.active) {
|
||||
unregister();
|
||||
} else {
|
||||
register();
|
||||
}
|
||||
}
|
||||
|
||||
public void unregister() {
|
||||
if (hookId != null) {
|
||||
NCPHookManager.removeHook(this);
|
||||
this.hookId = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void register() {
|
||||
unregister();
|
||||
this.hookId = NCPHookManager.addHook(CheckType.MOVING_SURVIVALFLY, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return "ViolationFrequency(NCP)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckFailure(final CheckType checkType, final Player player, final IViolationInfo info) {
|
||||
final ViolationFrequencyConfig config = this.config;
|
||||
final StringBuilder builder = new StringBuilder(300);
|
||||
if (info.getTotalVl() > config.maxtotalvls) return false;
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (pData != null) {
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
|
||||
if (info.getAddedVl() > config.minaddedvls) {
|
||||
if (config.debug) {
|
||||
builder.append("SurvivalFly: ");
|
||||
builder.append("VL=" + StringUtil.fdec1.format(info.getTotalVl()));
|
||||
builder.append("(+" + StringUtil.fdec1.format(info.getAddedVl()) + ")");
|
||||
log(builder.toString(), player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
final int lastviolationmove = data.getPlayerMoveCount() - data.sfVLTime;
|
||||
if (lastviolationmove <= config.movecount) {
|
||||
data.survivalFlyVL += config.morevls;
|
||||
if (config.debug) {
|
||||
builder.append("SurvivalFly: ");
|
||||
builder.append("VL=" + StringUtil.fdec1.format(info.getTotalVl()));
|
||||
builder.append("(+" + StringUtil.fdec1.format(info.getAddedVl()) + ") -> ");
|
||||
builder.append("VL=" + StringUtil.fdec1.format(info.getTotalVl() + config.morevls));
|
||||
builder.append("(+" + StringUtil.fdec1.format(info.getAddedVl() + config.morevls) + ")");
|
||||
log(builder.toString(), player);
|
||||
}
|
||||
if (info.getTotalVl() + config.morevls <= config.maxtotalvls) return true; else return false;
|
||||
}
|
||||
|
||||
if (config.debug) {
|
||||
builder.append("SurvivalFly: ");
|
||||
builder.append("VL=" + StringUtil.fdec1.format(info.getTotalVl()));
|
||||
builder.append("(+" + StringUtil.fdec1.format(info.getAddedVl()) + ")");
|
||||
log(builder.toString(), player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void log(String s, Player p) {
|
||||
final LogManager logManager = NCPAPIProvider.getNoCheatPlusAPI().getLogManager();
|
||||
final StringBuilder builder = new StringBuilder(300);
|
||||
builder.append("ViolationFrequency");
|
||||
builder.append(" [" + ChatColor.YELLOW + p.getName());
|
||||
builder.append(ChatColor.WHITE + "] ");
|
||||
builder.append(s);
|
||||
final String message = builder.toString();
|
||||
logManager.info(Streams.NOTIFY_INGAME, message);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ version: ${project.version}-b1153-CustomFork
|
||||
description: ${project.description}
|
||||
|
||||
author: NeatMonster
|
||||
authors: [asofold, Evenprime]
|
||||
authors: [asofold, Evenprime, CaptainObvious0, xaw3ep]
|
||||
website: ${project.url}
|
||||
dev-url: ${project.url}
|
||||
|
||||
@@ -105,8 +105,6 @@ permissions:
|
||||
default: false
|
||||
nocheatplus.checks.fight.speed.silent:
|
||||
default: false
|
||||
nocheatplus.checks.fight.wrongturn.silent:
|
||||
default: false
|
||||
nocheatplus.checks.inventory.drop.silent:
|
||||
default: false
|
||||
nocheatplus.checks.inventory.fastclick.silent:
|
||||
@@ -147,6 +145,8 @@ permissions:
|
||||
default: false
|
||||
nocheatplus.checks.net.packetfrequency.silent:
|
||||
default: false
|
||||
nocheatplus.checks.net.wrongturn.silent:
|
||||
default: false
|
||||
# Check bypass permissions:
|
||||
nocheatplus.checks:
|
||||
description: Allow the player to bypass all checks.
|
||||
@@ -251,8 +251,6 @@ permissions:
|
||||
description: Allow the player to bypass the SelfHit check.
|
||||
nocheatplus.checks.fight.speed:
|
||||
description: Allow the player to bypass the Speed check.
|
||||
nocheatplus.checks.fight.wrongturn:
|
||||
description: Allow the player to bypass the WrongTurn check.
|
||||
nocheatplus.checks.inventory:
|
||||
description: Allow the player to bypass all Inventory checks.
|
||||
children:
|
||||
@@ -320,6 +318,8 @@ permissions:
|
||||
description: Bypass the KeepAliveFrequency check (keep alive packet spam).
|
||||
nocheatplus.checks.net.packetfrequency:
|
||||
description: Bypass the PacketFrequency check (overall packet spam).
|
||||
nocheatplus.checks.net.wrongturn:
|
||||
description: Allow the player to bypass the WrongTurn check.
|
||||
|
||||
nocheatplus.mods:
|
||||
description: Allow the player to use all the client mods.
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus</artifactId>
|
||||
<name>NoCheatPlus</name>
|
||||
<version>3.16.1-SNAPSHOT</version>
|
||||
<version>3.17-SNAPSHOT</version>
|
||||
<description>Detect and fight the exploitation of various flaws/bugs in Minecraft.</description>
|
||||
<url>https://dev.bukkit.org/projects/nocheatplus</url>
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
### 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).
|
||||
[](https://ci.codemc.io/job/Updated-NoCheatPlus/job/Updated-NoCheatPlus/)
|
||||
[](https://discord.gg/NASKHYc)
|
||||
|
||||
Installation
|
||||
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.
|
||||
|
||||
Installation (outdated)
|
||||
---------
|
||||
* [Install a Spigot server](https://github.com/NoCheatPlus/NoCheatPlus/#obtain-a-build-of-spigot)
|
||||
* [Download NoCheatPlus](https://github.com/NoCheatPlus/NoCheatPlus/#download)
|
||||
* [Install a Spigot server](https://www.spigotmc.org/wiki/spigot-installation/)
|
||||
* [Download NoCheatPlus](https://ci.codemc.io/job/Updated-NoCheatPlus/job/Updated-NoCheatPlus/)
|
||||
* Drop the NoCheatPlus.jar in to the plugins folder.
|
||||
* Start your Spigot/CraftBukkit server. (Using /reload can have unwanted side effects with players still online, but also with complex plugins and cross-plugin dependencies, so we don't recommend it. Usually it should work with NCP.)
|
||||
|
||||
Hints
|
||||
---------
|
||||
* Be sure that your Spigot/CraftBukkit and NoCheatPlus versions match together. The latest version of NCP is compatible with a wide range of CraftBukkit/Spigot versions ([See the notable builds page for a quick overview.]()).
|
||||
* Be sure that your Spigot/CraftBukkit and NoCheatPlus versions match together. The latest version of NCP is compatible with a wide range of CraftBukkit/Spigot versions.
|
||||
* 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.
|
||||
* Use [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997/) 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/).
|
||||
@@ -77,11 +77,11 @@ TODO: Better place for descriptions like this?</description>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
Reference in new issue
Block a user