mirror of
https://github.com/Updated-NoCheatPlus/NoCheatPlus.git
synced 2026-11-08 09:35:18 -05:00
Compare commits
144
Commits
v1.3-beta.5
...
v1.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2a2687b83 | ||
|
|
e90d8306a4 | ||
|
|
c84966bbd4 | ||
|
|
83426ab04f | ||
|
|
39e0f10019 | ||
|
|
008f1a7a7e | ||
|
|
55b9590a52 | ||
|
|
a73ad559df | ||
|
|
0bbd26dd9b | ||
|
|
b39f8e0bf4 | ||
|
|
c2512bc014 | ||
|
|
f588275d37 | ||
|
|
3034c8db7a | ||
|
|
d3be5af828 | ||
|
|
17d2c3245d | ||
|
|
41bf0cc684 | ||
|
|
0a973ff745 | ||
|
|
c7137ff5b6 | ||
|
|
e1357e96f2 | ||
|
|
2b313d70fa | ||
|
|
517e4be891 | ||
|
|
08b2f47404 | ||
|
|
9a2473029f | ||
|
|
f6a1d2bed7 | ||
|
|
f5ad1d36ae | ||
|
|
7d41589529 | ||
|
|
ab4d0a9004 | ||
|
|
a823f1e6e8 | ||
|
|
4736f75563 | ||
|
|
3ea26bf0cb | ||
|
|
eb52a3c516 | ||
|
|
e770a09342 | ||
|
|
6bd529cc40 | ||
|
|
07aed9bb6c | ||
|
|
38ff02682a | ||
|
|
43195a3a8d | ||
|
|
9500b491f0 | ||
|
|
b91bceaf38 | ||
|
|
7473559e6f | ||
|
|
2a1678dcb5 | ||
|
|
3822f69fe3 | ||
|
|
bda7cc7742 | ||
|
|
1e3e2b0842 | ||
|
|
83a391d15d | ||
|
|
2e26c51988 | ||
|
|
d640a702d6 | ||
|
|
eee2eab5ce | ||
|
|
1822366c87 | ||
|
|
bc6b9e548f | ||
|
|
77d9a806cc | ||
|
|
c5ccf0c237 | ||
|
|
d1b6bc0ac2 | ||
|
|
0f57ca23a6 | ||
|
|
5b6d0475da | ||
|
|
36af146c10 | ||
|
|
263ec46f19 | ||
|
|
df58970cd9 | ||
|
|
3e2a99e2e5 | ||
|
|
c24346708d | ||
|
|
94ed22789c | ||
|
|
2e41d0273d | ||
|
|
e47260d5c7 | ||
|
|
8286810566 | ||
|
|
63c9e403e4 | ||
|
|
b4e4999803 | ||
|
|
20fc013b6e | ||
|
|
b3143bc432 | ||
|
|
cc96d90199 | ||
|
|
b3da6cf1af | ||
|
|
50d5fdffb6 | ||
|
|
e746ba5c92 | ||
|
|
7d01b45e93 | ||
|
|
f0d22a110d | ||
|
|
e1b11c367c | ||
|
|
2ada6d74cc | ||
|
|
7b8d285c83 | ||
|
|
35cc00b3b2 | ||
|
|
60a8b7db9d | ||
|
|
ff0497ec62 | ||
|
|
9a32beb9ba | ||
|
|
b880e5ddd2 | ||
|
|
bf431db516 | ||
|
|
110de1eef3 | ||
|
|
15d2923407 | ||
|
|
528cf5e5e1 | ||
|
|
90d0f41824 | ||
|
|
2dca31bf63 | ||
|
|
f287974765 | ||
|
|
a5021c5bdb | ||
|
|
3d7f20bb29 | ||
|
|
2e05c37f25 | ||
|
|
b069c6c494 | ||
|
|
1f6bc2694a | ||
|
|
e72929d87b | ||
|
|
e4569977e9 | ||
|
|
de08c6d400 | ||
|
|
55263ce969 | ||
|
|
327be7b302 | ||
|
|
2537611620 | ||
|
|
7c9a081a63 | ||
|
|
7da9bde43f | ||
|
|
52e3ea1556 | ||
|
|
f599946e3c | ||
|
|
693789a448 | ||
|
|
485f4d2e82 | ||
|
|
e1b554edd0 | ||
|
|
bd46085c46 | ||
|
|
6d4dbb28e8 | ||
|
|
4a192f3a1b | ||
|
|
a3b3d4a482 | ||
|
|
e44da6266f | ||
|
|
d737693787 | ||
|
|
b7b684917e | ||
|
|
3e0af41412 | ||
|
|
a8060ff3d2 | ||
|
|
cd5444b794 | ||
|
|
770b0b9322 | ||
|
|
47f2e0267c | ||
|
|
361c1e8355 | ||
|
|
cbcef74a54 | ||
|
|
6bb4f682e9 | ||
|
|
b638d0dff9 | ||
|
|
9961dc99b7 | ||
|
|
5d32ce87af | ||
|
|
e4761ef731 | ||
|
|
682a5717f5 | ||
|
|
c9787ac81b | ||
|
|
1cfab2ee1a | ||
|
|
fb114c3532 | ||
|
|
5f89bbf462 | ||
|
|
a2ac285c0c | ||
|
|
b58049b81a | ||
|
|
da9f94e566 | ||
|
|
cc50883150 | ||
|
|
8c1408546a | ||
|
|
8fda3b0d1f | ||
|
|
9cd142e942 | ||
|
|
e7560fa894 | ||
|
|
e7761cc1e4 | ||
|
|
ae8d5bcd01 | ||
|
|
e60343cd52 | ||
|
|
e20b240669 | ||
|
|
791fabcaf8 | ||
|
|
168eadfec2 |
No files matched your search
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -44,3 +44,4 @@
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
public String getMCVersion() {
|
||||
// Bukkit API.
|
||||
// TODO: maybe output something else.
|
||||
return "1.4.6-1.11.2|?"; // uh oh
|
||||
return "1.6.1-1.14.4|?"; // uh oh
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+48
-31
@@ -21,21 +21,7 @@ import org.bukkit.Material;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitChorusPlant;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitCocoa;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDirectionalCentered;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitEndPortalFrame;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitFence;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitGate;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitSeaPickle;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShapeModel;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShulkerBox;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitSlab;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitStairs;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitStatic;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitTrapDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitTurtleEgg;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.*;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
@@ -71,16 +57,22 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
0.4375, 1.0);
|
||||
private static final BukkitShapeModel MODEL_THICK_FENCE = new BukkitFence(
|
||||
0.375, 1.5);
|
||||
private static final BukkitShapeModel MODEL_THICK_FENCE2 = new BukkitWall(
|
||||
0.25, 1.5);
|
||||
// .75 .25 0 max: .25 .75 .5
|
||||
private static final BukkitShapeModel MODEL_WALL_HEAD = new BukkitStatic(
|
||||
0.75, 0.25, 0.0, 0.25, 0.75, 0.5);
|
||||
private static final BukkitShapeModel MODEL_WALL_HEAD = new BukkitWallHead();
|
||||
|
||||
|
||||
// Static blocks (various height and inset values).
|
||||
private static final BukkitShapeModel MODEL_BELL = new BukkitBell();
|
||||
private static final BukkitShapeModel MODEL_LECTERN = new BukkitStatic(0.25, 0.875);
|
||||
private static final BukkitShapeModel MODEL_BAMBOO = new BukkitBamboo();
|
||||
private static final BukkitShapeModel MODEL_ANVIL = new BukkitAnvil();
|
||||
private static final BukkitShapeModel MODEL_LILY_PAD = new BukkitStatic(
|
||||
0.09375);
|
||||
private static final BukkitShapeModel MODEL_FLOWER_POT = new BukkitStatic(
|
||||
0.33, 0.375); // TODO: XZ really?
|
||||
private static final BukkitShapeModel MODEL_LANTERN = new BukkitLantern();
|
||||
private static final BukkitShapeModel MODEL_CONDUIT = new BukkitStatic(
|
||||
0.33, 0.6875);
|
||||
private static final BukkitShapeModel MODEL_GROUND_HEAD= new BukkitStatic(
|
||||
@@ -130,7 +122,7 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
return "1.13|?";
|
||||
return "1.13-1.14.4|?";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,21 +141,20 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
// TODO: Also consider removing flags (passable_x4 etc).
|
||||
|
||||
// Variables for repeated flags (Temporary flags, these should be fixed later so that they are not added here)
|
||||
final long headFlags = BlockFlags.SOLID_GROUND | BlockProperties.F_XZ100 | BlockProperties.F_IGN_PASSABLE;
|
||||
final long blockFix = BlockFlags.SOLID_GROUND | BlockProperties.F_XZ100 | BlockProperties.F_IGN_PASSABLE;
|
||||
final long blockFix = BlockFlags.SOLID_GROUND;
|
||||
// Adjust flags for individual blocks.
|
||||
BlockProperties.setBlockFlags(Material.CAULDRON,
|
||||
BlockFlags.SOLID_GROUND | BlockProperties.F_GROUND_HEIGHT
|
||||
| BlockProperties.F_MIN_HEIGHT4_1);
|
||||
BlockProperties.setBlockFlags(Material.COCOA, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.TURTLE_EGG, BlockProperties.F_IGN_PASSABLE | BlockFlags.SOLID_GROUND | BlockProperties.F_GROUND | BlockProperties.F_XZ100);
|
||||
BlockProperties.setBlockFlags(Material.TURTLE_EGG, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.CHORUS_PLANT, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.CREEPER_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.ZOMBIE_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.PLAYER_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.DRAGON_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.WITHER_SKELETON_WALL_SKULL, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.SKELETON_WALL_SKULL, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.CREEPER_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.ZOMBIE_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.PLAYER_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.DRAGON_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.WITHER_SKELETON_WALL_SKULL, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.SKELETON_WALL_SKULL, blockFix);
|
||||
|
||||
// Directly keep blocks as is.
|
||||
for (final Material mat : new Material[] {
|
||||
@@ -176,14 +167,20 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
Material.BEACON,
|
||||
Material.LADDER,
|
||||
Material.VINE,
|
||||
Material.ANVIL,
|
||||
Material.CHIPPED_ANVIL,
|
||||
Material.DAMAGED_ANVIL,
|
||||
Material.CHORUS_FLOWER
|
||||
}) {
|
||||
processedBlocks.add(mat);
|
||||
}
|
||||
|
||||
//Anvil
|
||||
for (Material mat : new Material[] {
|
||||
Material.ANVIL,
|
||||
Material.CHIPPED_ANVIL,
|
||||
Material.DAMAGED_ANVIL
|
||||
}) {
|
||||
addModel(mat, MODEL_ANVIL);
|
||||
}
|
||||
|
||||
// Lily pad
|
||||
addModel(BridgeMaterial.LILY_PAD, MODEL_LILY_PAD);
|
||||
|
||||
@@ -330,6 +327,22 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
addModel(mat, MODEL_CHORUS_PLANT);
|
||||
}
|
||||
|
||||
//Lantern
|
||||
Material mt = BridgeMaterial.getBlock("lantern");
|
||||
if (mt != null) addModel(mt, MODEL_LANTERN);
|
||||
|
||||
// Lectern
|
||||
mt = BridgeMaterial.getBlock("lectern");
|
||||
if (mt != null) addModel(mt, MODEL_LECTERN);
|
||||
|
||||
// Bamboo
|
||||
mt = BridgeMaterial.getBlock("bamboo");
|
||||
if (mt != null) addModel(mt, MODEL_BAMBOO);
|
||||
|
||||
// Bell
|
||||
mt = BridgeMaterial.getBlock("bell");
|
||||
if (mt != null) addModel(mt, MODEL_BELL);
|
||||
|
||||
// Sort to processed by flags.
|
||||
for (final Material mat : Material.values()) {
|
||||
final long flags = BlockProperties.getBlockFlags(mat);
|
||||
@@ -337,7 +350,7 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_STAIRS)) {
|
||||
addModel(mat, MODEL_STAIRS);
|
||||
}
|
||||
// Fences, cobblestone wall.
|
||||
// Fences.
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_THICK_FENCE)) {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_PASSABLE_X4)) {
|
||||
// TODO: Perhaps another model flag.
|
||||
@@ -347,6 +360,10 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
addModel(mat, MODEL_THICK_FENCE);
|
||||
}
|
||||
}
|
||||
// Walls
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_THICK_FENCE2)) {
|
||||
addModel(mat, MODEL_THICK_FENCE2);
|
||||
}
|
||||
}
|
||||
|
||||
super.setupBlockProperties(worldConfigProvider);
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitAnvil implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Directional) {
|
||||
BlockFace face = ((Directional) blockData).getFacing();
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.1815, 0.0, 0.0, 1.0 - 0.1815, 1.0, 1.0};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.0, 0.1815, 1.0, 1.0, 1.0 - 0.1815};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitBamboo implements BukkitShapeModel {
|
||||
private DecimalFormat df = new DecimalFormat("#.000");
|
||||
private final double xz = 0.375;
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
|
||||
double minX = Math.abs(block.getBoundingBox().getMinX()) - Math.abs((int) block.getBoundingBox().getMinX());
|
||||
double minZ = Math.abs(block.getBoundingBox().getMinZ()) - Math.abs((int) block.getBoundingBox().getMinZ());
|
||||
|
||||
minX = Double.parseDouble(df.format(minX));
|
||||
minZ = Double.parseDouble(df.format(minZ));
|
||||
|
||||
//return new double[] {1.0 - minX + 0.09, 0.0, minZ + 0.09, 1.0 - minX + xz - 0.09, 1.0, minZ + xz - 0.09}; (1)
|
||||
//return new double[] {minX + 0.09, 0.0, 1.0 - minZ + 0.09, minX + xz - 0.09, 1.0, 1.0 - minZ + xz - 0.09}; (2)
|
||||
// (1) + (2) =>
|
||||
return new double[] {1.0 - minX + 0.09, 0.0, 1.0 - minZ + 0.09, 1.0 - minX + xz - 0.09, 1.0, 1.0 - minZ + xz - 0.09};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Bell;
|
||||
import org.bukkit.block.data.type.Bell.Attachment;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitBell implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Bell) {
|
||||
Bell b = (Bell) blockData;
|
||||
BlockFace face = b.getFacing();
|
||||
switch (b.getAttachment()) {
|
||||
case CEILING: return new double[] {0.25, 1-0.75, 0.25, 0.75, 1.0, 0.75};
|
||||
case DOUBLE_WALL:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.375, 0.0, 0.75, 0.9375, 1.0};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.375, 0.25, 1.0, 0.9375, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FLOOR:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.0, 0.0, 0.25, 1.0, 1.0, 0.75};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {0.25, 0.0, 0.0, 0.75, 1.0, 1.0};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SINGLE_WALL:
|
||||
switch (face) {
|
||||
case NORTH: return new double[] {0.25, 0.375, 0.0, 0.75, 0.9375, 1 - 0.1875};
|
||||
case SOUTH: return new double[] {0.25, 0.375, 0.1875, 0.75, 0.9375, 1.0};
|
||||
case WEST: return new double[] {0.0, 0.375, 0.25, 1.0 - 0.1875, 0.9375, 0.75};
|
||||
case EAST: return new double[] {0.1875, 0.375, 0.25, 1.0, 0.9375, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Bell) {
|
||||
Bell b = (Bell) blockData;
|
||||
if (b.getAttachment() == Attachment.SINGLE_WALL) return 0x4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+30
-12
@@ -14,12 +14,9 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.MultipleFacing;
|
||||
|
||||
@@ -32,16 +29,37 @@ public class BukkitChorusPlant implements BukkitShapeModel {
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
double[] res = new double[] {0.187, 0.188, 0.187, 1.0 - 0.187, 0.8125, 1.0 - 0.187};
|
||||
if (blockData instanceof MultipleFacing) {
|
||||
final MultipleFacing chorusplant = (MultipleFacing) blockData;
|
||||
for (final BlockFace face : chorusplant.getFaces()) {
|
||||
switch (face) {
|
||||
//case DOWN:
|
||||
// res[1]=0.0;
|
||||
// break;
|
||||
case UP:
|
||||
res[4]=1.0;
|
||||
break;
|
||||
case SOUTH:
|
||||
res[5]=1.0;
|
||||
break;
|
||||
case NORTH:
|
||||
res[2]=0.0;
|
||||
break;
|
||||
case WEST:
|
||||
res[0]=0.0;
|
||||
break;
|
||||
case EAST:
|
||||
res[3]=1.0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double minX = Math.abs(block.getBoundingBox().getMinX()) - Math.abs((int) block.getBoundingBox().getMinX());
|
||||
double minY = Math.abs(block.getBoundingBox().getMinY()) - Math.abs((int) block.getBoundingBox().getMinY());
|
||||
double minZ = Math.abs(block.getBoundingBox().getMinZ()) - Math.abs((int) block.getBoundingBox().getMinZ());
|
||||
|
||||
double maxX = Math.abs(block.getBoundingBox().getMaxX()) - Math.abs((int) block.getBoundingBox().getMaxX());
|
||||
double maxY = Math.abs(block.getBoundingBox().getMaxY()) - Math.abs((int) block.getBoundingBox().getMaxY());
|
||||
double maxZ = Math.abs(block.getBoundingBox().getMaxZ()) - Math.abs((int) block.getBoundingBox().getMaxZ());
|
||||
|
||||
return new double[] {minX, minY, minZ, maxX, maxY, maxZ};
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+43
-7
@@ -16,8 +16,10 @@ package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.type.Cocoa;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
@@ -31,17 +33,51 @@ public class BukkitCocoa implements BukkitShapeModel {
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof Cocoa) {
|
||||
if (blockData instanceof Cocoa && blockData instanceof Directional) {
|
||||
BlockFace face = ((Directional) blockData).getFacing();
|
||||
final Cocoa cocoa = (Cocoa) blockData;
|
||||
switch (cocoa.getAge()) {
|
||||
case 0: // .625 .4375 .0625 max: .375 .75 .3125
|
||||
return new double[] {0.625, 0.4375, 0.0625, 0.375, 0.75, 0.3125};
|
||||
case 1: // .6875 .3125 .0625 max: .3125 .75 .4375
|
||||
return new double[] {0.6875, 0.3125, 0.0625, 0.3125, 0.75, 0.4375};
|
||||
case 2: // .75 .1875 .0625 max: .25 .75 .5625
|
||||
return new double[] {0.75, 0.1875, 0.0625, 0.25, 0.75, 0.5625};
|
||||
default:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.375, 0.4375, 0.0, 0.625, 0.75, 0.315};
|
||||
case SOUTH:
|
||||
return new double[] {0.375, 0.4375, 0.685, 0.625, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.4375, 0.375, 0.315, 0.75, 0.625};
|
||||
case EAST:
|
||||
return new double[] {0.685, 0.4375, 0.375, 1.0, 0.75, 0.625};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1: // .6875 .3125 .0625 max: .3125 .75 .4375
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.3125, 0.3125, 0.0, 0.6875, 0.75, 0.4375};
|
||||
case SOUTH:
|
||||
return new double[] {0.3125, 0.3125, 0.5625, 0.6875, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.3125, 0.3125, 0.4375, 0.75, 0.6875};
|
||||
case EAST:
|
||||
return new double[] {0.5625, 0.3125, 0.3125, 1.0, 0.75, 0.6875};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: // .75 .1875 .0625 max: .25 .75 .5625
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.25, 0.1875, 0.0, 0.75, 0.75, 0.5625};
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.1875, 0.4375, 0.75, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.1875, 0.25, 0.5625, 0.75, 0.75};
|
||||
case EAST:
|
||||
return new double[] {0.4375, 0.1875, 0.25, 1.0, 0.75, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Lantern;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitLantern implements BukkitShapeModel {
|
||||
|
||||
private double xz = 0.33;
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Lantern) {
|
||||
Lantern lantern = (Lantern) blockData;
|
||||
if (lantern.isHanging()) return new double[] {xz, 0.0625, xz, 1-xz, 1, 1-xz};
|
||||
}
|
||||
return new double[] {xz, 0.0, xz, 1.0 - xz, 0.5625, 1.0 - xz};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+8
-8
@@ -34,14 +34,14 @@ public class BukkitSeaPickle implements BukkitShapeModel {
|
||||
if (blockData instanceof SeaPickle) {
|
||||
final SeaPickle pick = (SeaPickle) blockData;
|
||||
switch (pick.getPickles()) {
|
||||
case 1: // .625 , 0 , .375 max: .375 , 375 , .625
|
||||
return new double[] {0.625, 0.0, 0.375, 0.375, 0.375, 0.625};
|
||||
case 2: // .8125 , 0 , .1875 max: .1875 , .375 , .8125
|
||||
return new double[] {0.8125, 0.0, 0.1875, 0.1875, 0.375, 0.8125};
|
||||
case 3: // .875 0 .125 max: .125 .375 .875
|
||||
return new double[] {0.875, 0.0, 0.125, 0.125, 0.375, 0.875};
|
||||
case 4: // .875 0 .125 max: .125 .4375 .875
|
||||
return new double[] {0.875, 0.0, 0.125, 0.125, 0.4375, 0.875};
|
||||
case 1: // .375 , 0 , .375 max: .625 , 375 , .625
|
||||
return new double[] {0.375, 0.0, 0.375, 0.625, 0.375, 0.625};
|
||||
case 2: // .1875 , 0 , .1875 max: .8125 , .375 , .8125
|
||||
return new double[] {0.1875, 0.0, 0.1875, 0.8125, 0.375, 0.8125};
|
||||
case 3: // .125 0 .125 max: .875 .375 .875
|
||||
return new double[] {0.125, 0.0, 0.125, 0.875, 0.375, 0.875};
|
||||
case 4: // .125 0 .125 max: .875 .4375 .875
|
||||
return new double[] {0.125, 0.0, 0.125, 0.875, 0.4375, 0.875};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+2
-2
@@ -35,11 +35,11 @@ public class BukkitTurtleEgg implements BukkitShapeModel {
|
||||
final TurtleEgg egg = (TurtleEgg) blockData;
|
||||
switch (egg.getEggs()) {
|
||||
case 1: // .8125 0.0 .1875 max: .25 .4375 .75
|
||||
return new double[] {0.8125, 0.0, 0.1875, 0.25, 0.4375, 0.75};
|
||||
return new double[] {0.23, 0.0, 0.23, 0.75, 0.4375, 0.75};
|
||||
case 2: // .9375 .0 .0625 max: 0.0625 .4375 .9375
|
||||
case 3:
|
||||
case 4:
|
||||
return new double[] {0.9375, 0.0, 0.0625, 0.0625, 0.4375, 0.9375};
|
||||
return new double[] {0.0625, 0.0, 0.0625, 0.9375, 0.4375, 0.9375};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.MultipleFacing;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitWall implements BukkitShapeModel {
|
||||
|
||||
private final double minXZ;
|
||||
private final double maxXZ;
|
||||
private final double height;
|
||||
|
||||
public BukkitWall(double inset, double height) {
|
||||
this(inset, 1.0 - inset, height);
|
||||
}
|
||||
|
||||
public BukkitWall(double minXZ, double maxXZ, double height) {
|
||||
this.minXZ = minXZ;
|
||||
this.maxXZ = maxXZ;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof MultipleFacing) {
|
||||
// Note isPassableWorkaround for these (no voxel shapes / multi cuboid yet).
|
||||
final MultipleFacing fence = (MultipleFacing) blockData;
|
||||
// TODO: If height > 1.0, check if it needs to be capped, provided relevant.
|
||||
double[] res = new double[] {minXZ, 0.0, minXZ, maxXZ, height, maxXZ};
|
||||
for (final BlockFace face : fence.getFaces()) {
|
||||
switch (face) {
|
||||
case EAST:
|
||||
res[3] = 1.0;
|
||||
break;
|
||||
case NORTH:
|
||||
res[2] = 0.0;
|
||||
break;
|
||||
case WEST:
|
||||
res[0] = 0.0;
|
||||
break;
|
||||
case SOUTH:
|
||||
res[5] = 1.0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
final Set<BlockFace> a = fence.getFaces();
|
||||
if (!a.contains(BlockFace.UP) && a.size() == 2) {
|
||||
if (a.contains(BlockFace.SOUTH)) {
|
||||
res[0] = 0.33;
|
||||
res[3] = 1 - 0.33;
|
||||
}
|
||||
if (a.contains(BlockFace.WEST)) {
|
||||
res[2] = 0.33;
|
||||
res[5] = 1 - 0.33;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitWallHead implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Directional) {
|
||||
BlockFace face = ((Directional) blockData).getFacing();
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.25, 0.25, 0.5, 0.75, 0.75, 1.0};
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.25, 0.0, 0.75, 0.75, 0.5};
|
||||
case WEST:
|
||||
return new double[] {0.5, 0.25, 0.25, 1.0, 0.75, 0.75};
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.25, 0.25, 0.5, 0.75, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -53,7 +53,7 @@ public class MCAccessCBReflect extends MCAccessBukkitModern {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().warning(Streams.INIT, "The Minecraft version seems to be older than what Compat-CB-Reflect can support.");
|
||||
this.knownSupportedVersion = false;
|
||||
}
|
||||
else if (GenericVersion.compareVersions(mcVersion, "1.12.2") > 0) {
|
||||
else if (GenericVersion.compareVersions(mcVersion, "1.14.4") > 0) {
|
||||
this.knownSupportedVersion = false;
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().warning(Streams.INIT, "The Minecraft version seems to be more recent than the one Compat-CB-Reflect has been built with - this might work, but there could be incompatibilities.");
|
||||
} else {
|
||||
@@ -71,7 +71,7 @@ public class MCAccessCBReflect extends MCAccessBukkitModern {
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
// Potentially all :p.
|
||||
return "1.4.5-1.13|?";
|
||||
return "1.7-1.14.4|?";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.10-R0.1-SNAPSHOT</version>
|
||||
<version>1.10.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
To add a new compat module the pom.xml file within NCPCompatNonFree has to be modified:
|
||||
- Add as module within the profile with id 'all'.
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
|
||||
<build>
|
||||
@@ -49,4 +49,4 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.11.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.11-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
To add a new compat module the pom.xml file within NCPCompatNonFree has to be modified:
|
||||
- Add as module within the profile with id 'all'.
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
|
||||
<build>
|
||||
@@ -49,4 +49,4 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.8.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -39,4 +39,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
<description>Compatibility for Minecraft 1.8.4-1.8.6 with CraftBukkit/Spigot (1_8_R3).</description>
|
||||
</project>
|
||||
</project>
|
||||
+379
-379
@@ -1,381 +1,381 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<name>NCPCompatNonFree</name>
|
||||
<description>Combine compatibility modules with dependencies that can't be obtained from a public maven repository, such as CraftBukkit or Spigot builds, hence "NonFree".
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<name>NCPCompatNonFree</name>
|
||||
<description>Combine compatibility modules with dependencies that can't be obtained from a public maven repository, such as CraftBukkit or Spigot builds, hence "NonFree".
|
||||
|
||||
To add a new compat module:
|
||||
- Add as module within the profile with id 'all'.
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- Profile based activation of modules and dependencies. -->
|
||||
<profiles>
|
||||
|
||||
<profile>
|
||||
<id>all</id>
|
||||
|
||||
<modules>
|
||||
<module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module>
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
<module>NCPCompatCB3100</module>
|
||||
<module>NCPCompatSpigotCB1_8_R1</module>
|
||||
<module>NCPCompatSpigotCB1_8_R2</module>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
<!-- ... -->
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- ... -->
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_11_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_10_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r3</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3043</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3026</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2922</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2882</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2545</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2512</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>cbdev</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<!-- ... -->
|
||||
|
||||
<profile>
|
||||
<id>spigot1_12_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_11_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_11_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_10_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_10_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_9_r2</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_9_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_8_r3</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r3</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_7_r4</id>
|
||||
<modules>
|
||||
<module>NCPCompatCB3100</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>cblegacy</id>
|
||||
|
||||
<modules>
|
||||
<module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module>
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3043</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3026</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2922</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2882</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2545</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2512</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- Profile based activation of modules and dependencies. -->
|
||||
<profiles>
|
||||
|
||||
<profile>
|
||||
<id>all</id>
|
||||
|
||||
<modules>
|
||||
<!-- <module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module> -->
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
<module>NCPCompatCB3100</module>
|
||||
<module>NCPCompatSpigotCB1_8_R1</module>
|
||||
<module>NCPCompatSpigotCB1_8_R2</module>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
<!-- ... -->
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- ... -->
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_11_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_10_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r3</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3043</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3026</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2922</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2882</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2545</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2512</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency> -->
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>cbdev</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<!-- ... -->
|
||||
|
||||
<profile>
|
||||
<id>spigot1_12_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_11_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_11_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_10_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_10_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_9_r2</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_9_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_8_r3</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r3</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_7_r4</id>
|
||||
<modules>
|
||||
<module>NCPCompatCB3100</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>cblegacy</id>
|
||||
|
||||
<modules>
|
||||
<module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module>
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3043</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3026</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2922</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2882</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2545</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2512</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.net.protocollib;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.wrappers.EnumWrappers.PlayerDigType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
|
||||
import fr.neatmonster.nocheatplus.components.registry.order.RegistrationOrder.RegisterMethodWithOrder;
|
||||
import fr.neatmonster.nocheatplus.event.mini.MiniListener;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.InventoryUtil;
|
||||
|
||||
public class NoSlow extends BaseAdapter {
|
||||
private final static String dftag = "system.nocheatplus.noslow";
|
||||
private final static MiniListener<?>[] miniListeners = new MiniListener<?>[] {
|
||||
new MiniListener<PlayerItemConsumeEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerItemConsumeEvent event) {
|
||||
onItemConsume(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<PlayerInteractEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerInteractEvent event) {
|
||||
onItemInteract(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<InventoryOpenEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final InventoryOpenEvent event) {
|
||||
onInventoryOpen(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<PlayerItemHeldEvent>() {
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerItemHeldEvent event) {
|
||||
onChangeSlot(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static int timeBetweenRL = 53;
|
||||
private static PacketType[] initPacketTypes() {
|
||||
final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(
|
||||
PacketType.Play.Client.BLOCK_DIG
|
||||
));
|
||||
return types.toArray(new PacketType[types.size()]);
|
||||
}
|
||||
|
||||
public NoSlow(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, initPacketTypes());
|
||||
final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
|
||||
for (final MiniListener<?> listener : miniListeners) {
|
||||
api.addComponent(listener, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
handleDiggingPacket(event);
|
||||
}
|
||||
|
||||
private static void onItemConsume(final PlayerItemConsumeEvent e){
|
||||
final Player p = e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onInventoryOpen(final InventoryOpenEvent e){
|
||||
if (e.isCancelled()) return;
|
||||
final Player p = (Player) e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onItemInteract(final PlayerInteractEvent e){
|
||||
if (e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
Block b = e.getClickedBlock();
|
||||
if (p.getGameMode() == GameMode.CREATIVE) {
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (b != null && (
|
||||
b.getType().toString().endsWith("DOOR")
|
||||
|| b.getType().toString().endsWith("GATE")
|
||||
|| b.getType().toString().endsWith("BUTTON")
|
||||
|| b.getType().toString().endsWith("LEVER")
|
||||
)) {
|
||||
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;
|
||||
}
|
||||
|
||||
private static boolean hasArrow(PlayerInventory i) {
|
||||
if (Bridge1_9.hasElytra()) {
|
||||
Material m = i.getItemInOffHand().getType();
|
||||
return i.contains(Material.ARROW) || m.toString().endsWith("ARROW") || i.contains(Material.TIPPED_ARROW) || i.contains(Material.SPECTRAL_ARROW);
|
||||
}
|
||||
return i.contains(Material.ARROW);
|
||||
}
|
||||
|
||||
private void handleDiggingPacket(PacketEvent event)
|
||||
{
|
||||
if(event.getPacketType() != PacketType.Play.Client.BLOCK_DIG) return;
|
||||
|
||||
Player p = event.getPlayer();
|
||||
|
||||
if (p == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
return;
|
||||
}
|
||||
final IPlayerData pData = DataManager.getPlayerDataSafe(p);
|
||||
if (pData == null) {
|
||||
StaticLog.logWarning("Failed to fetch player data with " + event.getPacketType() + " for: " + p.toString());
|
||||
return;
|
||||
}
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
PlayerDigType digtype = event.getPacket().getPlayerDigTypes().read(0);
|
||||
data.isusingitem = false;
|
||||
|
||||
//Advanced check
|
||||
if(digtype == PlayerDigType.RELEASE_USE_ITEM) {
|
||||
long now = System.currentTimeMillis();
|
||||
if (data.time_rl_item != 0) {
|
||||
if (now < data.time_rl_item) {
|
||||
data.time_rl_item = now;
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (data.time_rl_item + timeBetweenRL > now) {
|
||||
data.isHackingRI = true;
|
||||
}
|
||||
}
|
||||
data.time_rl_item = now;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Minimum time between RELEASE_USE_ITEM packet is sent.
|
||||
* If time lower this value, A check will flag
|
||||
* Should be set from 51-100. Larger number, more protection more false-positive
|
||||
*
|
||||
* @param milliseconds
|
||||
*/
|
||||
public static void setuseRLThreshold(int time) {
|
||||
timeBetweenRL = time;
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -27,6 +27,7 @@ import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.CountableLocation;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
@@ -58,7 +59,15 @@ public class OutgoingPosition extends BaseAdapter {
|
||||
}
|
||||
final long time = System.currentTimeMillis();
|
||||
final Player player = event.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (player == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
return;
|
||||
}
|
||||
final IPlayerData pData = DataManager.getPlayerDataSafe(player);
|
||||
if (pData == null) {
|
||||
StaticLog.logWarning("Failed to fetch player data with " + event.getPacketType() + " for: " + player.toString());
|
||||
return;
|
||||
}
|
||||
// TODO: In future multiple checks might use this (!)
|
||||
if (pData.isCheckActive(CheckType.NET_FLYINGFREQUENCY, player)) {
|
||||
interpretPacket(player, event.getPacket(), time,
|
||||
|
||||
+3
-1
@@ -132,7 +132,9 @@ public class ProtocolLibComponent implements IDisableListener, INotifyReload, Jo
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.CatchAllAdapter", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
if (ServerVersion.compareMinecraftVersion("1.8") >= 0) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.NoSlow", plugin);
|
||||
}
|
||||
if (!registeredPacketAdapters.isEmpty()) {
|
||||
List<String> names = new ArrayList<String>(registeredPacketAdapters.size());
|
||||
for (PacketAdapter adapter : registeredPacketAdapters) {
|
||||
|
||||
+9
-3
@@ -15,9 +15,9 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -25,6 +25,12 @@
|
||||
<artifactId>ncpcommons</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<description>Core components and checks implementations. This contains about everything, just not the component/compat factories and not the plugin itself. NCPCore allows to add more modules/components that use check-specific classes to be added in the factories on NCPPlugin level.
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ public class BlockBreakListener extends CheckListener {
|
||||
|
||||
final Block block = event.getBlock();
|
||||
boolean cancelled = false;
|
||||
|
||||
if (block.getType().toString().equals("SCAFFOLDING")) return;
|
||||
// Do the actual checks, if still needed. It's a good idea to make computationally cheap checks first, because
|
||||
// it may save us from doing the computationally expensive checks.
|
||||
|
||||
|
||||
+5
@@ -186,6 +186,8 @@ public class BlockInteractListener extends CheckListener {
|
||||
if (block == null) {
|
||||
data.resetLastBlock();
|
||||
blockChecks = false;
|
||||
} else if (block.getType().toString().equals("SCAFFOLDING")) {
|
||||
blockChecks = false;
|
||||
}
|
||||
else {
|
||||
data.setLastBlock(block, action);
|
||||
@@ -205,6 +207,9 @@ public class BlockInteractListener extends CheckListener {
|
||||
if (stack != null && stack.getType() == Material.ENDER_PEARL) {
|
||||
checkEnderPearlRightClickBlock(player, block, face, event, previousLastTick, data, pData);
|
||||
}
|
||||
if (stack != null && stack.getType().toString().equals("SCAFFOLDING")) {
|
||||
blockChecks = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
data.setPlayerInteractEventResolution(event);
|
||||
|
||||
@@ -60,14 +60,22 @@ public class AutoSign extends Check {
|
||||
final BlockPlaceData data = pData.getGenericInstance(BlockPlaceData.class);
|
||||
final BlockPlaceConfig cc = pData.getGenericInstance(BlockPlaceConfig.class);
|
||||
Material mat = block.getType();
|
||||
if (mat == BridgeMaterial.SIGN || mat == Material.WALL_SIGN) {
|
||||
mat = Material.SIGN; // ITEM
|
||||
|
||||
String s = mat.toString();
|
||||
if (s.endsWith("_WALL_SIGN")) {
|
||||
s = s.replace("_WALL_SIGN", "_SIGN");
|
||||
mat = Material.getMaterial(s);
|
||||
} else if (s.endsWith("WALL_SIGN")) {
|
||||
s = s.replace("WALL_", "");
|
||||
mat = Material.getMaterial(s);
|
||||
}
|
||||
if (s.equals("SIGN_POST")) {
|
||||
mat = Material.getMaterial("SIGN");
|
||||
}
|
||||
if (data.autoSignPlacedHash != BlockPlaceListener.getBlockPlaceHash(block, mat)){
|
||||
tags.add("block_mismatch");
|
||||
return handleViolation(player, maxEditTime, data, cc);
|
||||
}
|
||||
// Still dont know how to fix this bug in 1.14
|
||||
//if (data.autoSignPlacedHash != BlockPlaceListener.getBlockPlaceHash(block, mat)){
|
||||
// tags.add("block_mismatch");
|
||||
// return handleViolation(player, maxEditTime, data, cc);
|
||||
//}
|
||||
if (time < data.autoSignPlacedTime){
|
||||
data.autoSignPlacedTime = 0;
|
||||
return false;
|
||||
|
||||
+10
-5
@@ -50,6 +50,7 @@ import fr.neatmonster.nocheatplus.checks.net.FlyingQueueHandle;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
|
||||
import fr.neatmonster.nocheatplus.components.data.ICheckData;
|
||||
import fr.neatmonster.nocheatplus.components.data.IData;
|
||||
@@ -212,16 +213,18 @@ public class BlockPlaceListener extends CheckListener {
|
||||
}
|
||||
shouldSkipSome = false;
|
||||
}
|
||||
} else if (placedMat.toString().equals("SCAFFOLDING")) {
|
||||
shouldSkipSome = true;
|
||||
}
|
||||
else {
|
||||
shouldSkipSome = false;
|
||||
}
|
||||
|
||||
if (placedMat == Material.SIGN) {
|
||||
if (placedMat.toString().endsWith("SIGN")) {
|
||||
// Might move to MONITOR priority.
|
||||
data.autoSignPlacedTime = System.currentTimeMillis();
|
||||
// Always hash as sign post for improved compatibility with Lockette etc.
|
||||
data.autoSignPlacedHash = getBlockPlaceHash(block, Material.SIGN);
|
||||
data.autoSignPlacedHash = getBlockPlaceHash(block, placedMat);
|
||||
}
|
||||
|
||||
// Don't run checks, if a set back is scheduled.
|
||||
@@ -410,13 +413,15 @@ public class BlockPlaceListener extends CheckListener {
|
||||
*/
|
||||
@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();
|
||||
Block targetBlock = player.getTargetBlock((Set<Material>) null, 7);
|
||||
|
||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK || !event.isBlockInHand() || player.isFlying() && player.getAllowFlight() || targetBlock.isLiquid() || player.isSneaking()) return;
|
||||
|
||||
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();
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
|
||||
/**
|
||||
* Legacy check (client side health regeneration).
|
||||
@@ -35,6 +36,9 @@ public class FastHeal extends Check {
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final IPlayerData pData){
|
||||
if (ServerVersion.compareMinecraftVersion("1.9") >= 0) {
|
||||
return false;
|
||||
}
|
||||
final long time = System.currentTimeMillis();
|
||||
|
||||
final FightConfig cc = pData.getGenericInstance(FightConfig.class);
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.Iterator;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Parrot;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -901,7 +900,7 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
final Player player = e.getPlayer();
|
||||
final FightData data = DataManager.getGenericInstance(player, FightData.class);
|
||||
|
||||
if (entity instanceof Parrot) {
|
||||
if (entity != null && entity.getType().name().equals("PARROT")) {
|
||||
data.exemptArmSwing = true;
|
||||
} else {
|
||||
data.exemptArmSwing = false;
|
||||
|
||||
@@ -125,6 +125,10 @@ public class FastClick extends Check {
|
||||
amount = 1f;
|
||||
}
|
||||
|
||||
if (isShiftClick && inventoryAction.equals("MOVE_TO_OTHER_INVENTORY") && (cursorMat != null && cursorMat != Material.AIR) && clickedMat != Material.AIR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
data.fastClickFreq.add(now, amount);
|
||||
|
||||
float shortTerm = data.fastClickFreq.bucketScore(0);
|
||||
|
||||
+9
-11
@@ -167,7 +167,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
}
|
||||
final InventoryConfig cc = pData.getGenericInstance(InventoryConfig.class);
|
||||
// Still check instantBow, whatever yawrate says.
|
||||
if (instantBow.check(player, event.getForce(), now)) {
|
||||
if (!event.getBow().getType().toString().equals("CROSSBOW") && instantBow.check(player, event.getForce(), now)) {
|
||||
// The check requested the event to be cancelled.
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@@ -265,7 +265,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
// Fast inventory manipulation check.
|
||||
if (fastClick.isEnabled(player, pData)) {
|
||||
final InventoryConfig cc = pData.getGenericInstance(InventoryConfig.class);
|
||||
if (player.getGameMode() != GameMode.CREATIVE || !cc.fastClickSpareCreative || !cc.inventoryExemptions.contains(ChatColor.stripColor(event.getInventory().getName()))) {
|
||||
if (!((event.getView().getType().equals(InventoryType.CREATIVE) || player.getGameMode() == GameMode.CREATIVE) && cc.fastClickSpareCreative) && !cc.inventoryExemptions.contains(ChatColor.stripColor(event.getView().getTitle()))) {
|
||||
if (fastClick.check(player, now,
|
||||
event.getView(), slot, cursor, clicked, event.isShiftClick(),
|
||||
inventoryAction, data, cc, pData)) {
|
||||
@@ -273,7 +273,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
cancel = true;
|
||||
}
|
||||
// Listen for more than just a chest?
|
||||
if (event.getInventory().getType().equals(InventoryType.CHEST) || event.getInventory().getType().equals(InventoryType.ENDER_CHEST)) {
|
||||
if (event.getInventory().getType().equals(InventoryType.CHEST) || event.getInventory().getType().equals(InventoryType.ENDER_CHEST) || event.getInventory().getType().toString().equals("BARREL") || event.getInventory().getType().toString().equals("SHULKER_BOX")) {
|
||||
if (fastClick.fastClickChest(player, data, cc)) {
|
||||
cancel = true;
|
||||
keepCancel = true;
|
||||
@@ -321,7 +321,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
|
||||
// Check left click too to prevent any bypasses
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock() != null || event.getAction() == Action.LEFT_CLICK_BLOCK && event.getClickedBlock() != null) {
|
||||
if (event.getClickedBlock().getType() == Material.CHEST || event.getClickedBlock().getType() == Material.ENDER_CHEST) {
|
||||
if (event.getClickedBlock().getType().toString().endsWith("CHEST") || event.getClickedBlock().getType().toString().equals("BARREL") || event.getClickedBlock().getType().toString().endsWith("SHULKER_BOX")) {
|
||||
data.chestOpenTime = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
@@ -361,10 +361,10 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
builder.append(view.getClass().getName());
|
||||
|
||||
// Bottom inventory.
|
||||
addInventory(player, view.getBottomInventory(), " , Bottom: ", builder);
|
||||
addInventory(player, view.getBottomInventory(), view, " , Bottom: ", builder);
|
||||
|
||||
// Top inventory.
|
||||
addInventory(player, view.getBottomInventory(), " , Top: ", builder);
|
||||
addInventory(player, view.getBottomInventory(), view, " , Top: ", builder);
|
||||
|
||||
if (action != null) {
|
||||
builder.append(" , Action: ");
|
||||
@@ -379,17 +379,15 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
debug(player, builder.toString());
|
||||
}
|
||||
|
||||
private void addInventory(final Player player, final Inventory inventory, final String prefix,
|
||||
private void addInventory(final Player player, final Inventory inventory, final InventoryView view, final String prefix,
|
||||
final StringBuilder builder) {
|
||||
builder.append(prefix);
|
||||
if (inventory == null) {
|
||||
builder.append("(none)");
|
||||
}
|
||||
else {
|
||||
final String name = inventory.getName();
|
||||
final String title = inventory.getTitle();
|
||||
final boolean same = name == null && title == null || name != null && name.equals(title);
|
||||
builder.append((same ? name : (name + "/" + title)));
|
||||
String name = view.getTitle();
|
||||
builder.append(name);
|
||||
builder.append("/");
|
||||
builder.append(inventory.getClass().getName());
|
||||
}
|
||||
|
||||
+3
-2
@@ -12,6 +12,7 @@ import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
|
||||
@@ -38,7 +39,7 @@ public class InventoryMove extends Check {
|
||||
else if (player.isSneaking()) {
|
||||
tags.add("isSneaking");
|
||||
}
|
||||
else if (player.isSwimming()) {
|
||||
else if (Bridge1_13.isSwimming(player)) {
|
||||
tags.add("isSwimming");
|
||||
}
|
||||
else if (player.isSprinting()) {
|
||||
@@ -49,7 +50,7 @@ public class InventoryMove extends Check {
|
||||
}
|
||||
|
||||
// Do the actual check
|
||||
if (player.isSneaking() || player.isSprinting() || player.isSwimming() || player.isBlocking() || player.isDead()) {
|
||||
if (player.isSneaking() || player.isSprinting() || Bridge1_13.isSwimming(player) || player.isBlocking() || player.isDead()) {
|
||||
// Check if the player is in creative
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
// (Skip hotbar interactions)
|
||||
|
||||
+1385
-1373
File diff suppressed because it is too large.
Load diff
+2955
-2859
File diff suppressed because it is too large.
Load diff
@@ -48,21 +48,27 @@ public class Magic {
|
||||
public static final double WALK_SPEED = 0.221D;
|
||||
public static final double modSneak = 0.13D / WALK_SPEED;
|
||||
// public static final double modSprint = 0.29 / walkSpeed; // TODO: without bunny 0.29 / practical is 0.35
|
||||
public static final double modBlock = 0.16D / WALK_SPEED;
|
||||
public static final double modSwim = 0.3D / WALK_SPEED; // 0.152D / WALK_SPEED
|
||||
public static final double modRiptide = 10.0D;
|
||||
public static final double modDolphinsGrace = 5.0D; // TODO: Adjust value to be more stricter and closer to actual movement speed, and use different value from in water vs above water
|
||||
public static final double 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[] 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[] modDepthStrider = new double[] {
|
||||
1.0,
|
||||
0.1645 / modSwim / WALK_SPEED,
|
||||
0.1995 / modSwim / WALK_SPEED,
|
||||
1.0 / modSwim, // Results in walkspeed.
|
||||
0.1645 / modSwim[0] / WALK_SPEED,
|
||||
0.1995 / modSwim[0] / WALK_SPEED,
|
||||
1.0 / modSwim[0], // Results in walkspeed.
|
||||
};
|
||||
public static final double modWeb = 0.105D / WALK_SPEED; // TODO: walkingSpeed * 0.15D; <- does not work
|
||||
public static final double modSoulSand = 0.16D / WALK_SPEED;
|
||||
public static final double modIce = 2.5D; //
|
||||
/** Faster moving down stream (water mainly). */
|
||||
public static final double modDownStream = 0.19 / (WALK_SPEED * modSwim);
|
||||
public static final double modDownStream = 0.19 / (WALK_SPEED * modSwim[0]);
|
||||
public static final double modDownStream2 = 0.19 / (WALK_SPEED * modSwim[1]);
|
||||
|
||||
/**
|
||||
* Somewhat arbitrary horizontal speed gain maximum for advance glide phase.
|
||||
@@ -125,9 +131,9 @@ public class Magic {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static double swimBaseSpeedV() {
|
||||
public static double swimBaseSpeedV(boolean isSwimming) {
|
||||
// TODO: Does this have to be the dynamic walk speed (refactoring)?
|
||||
return WALK_SPEED * modSwim + 0.1; // 0.244
|
||||
return isSwimming ? WALK_SPEED * modSwim[1] + 0.1 : WALK_SPEED * modSwim[0] + 0.1; // 0.244
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,7 @@ 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.workaround.WRPT;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
|
||||
public class MagicAir {
|
||||
@@ -273,7 +274,7 @@ public class MagicAir {
|
||||
&& yDistance - lastMove.yDistance < 0.0114
|
||||
// 1: Any leaving liquid and keeping distance once.
|
||||
|| data.sfJumpPhase == 1
|
||||
&& Math.abs(yDistance) <= Magic.swimBaseSpeedV() && yDistance == lastMove.yDistance
|
||||
&& Math.abs(yDistance) <= Magic.swimBaseSpeedV(Bridge1_13.isSwimming(from.getPlayer())) && yDistance == lastMove.yDistance
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
+35
-1
@@ -41,11 +41,14 @@ import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
|
||||
import fr.neatmonster.nocheatplus.components.modifier.IAttributeAccess;
|
||||
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.TrigUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* A check designed for people that are allowed to fly. The complement to the "SurvivalFly", which is for people that
|
||||
@@ -55,6 +58,7 @@ public class CreativeFly extends Check {
|
||||
|
||||
private final List<String> tags = new LinkedList<String>();
|
||||
private final BlockChangeTracker blockChangeTracker;
|
||||
private IGenericInstanceHandle<IAttributeAccess> attributeAccess = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(IAttributeAccess.class);
|
||||
|
||||
/**
|
||||
* Instantiates a new creative fly check.
|
||||
@@ -156,6 +160,14 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
|
||||
resultH *= 100.0; // Normalize to % of a block.
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
// Sometimes resultH can be up to 18
|
||||
if (Bridge1_9.isGliding(player) && (Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && resultH<14.0) {
|
||||
resultH = 0.0;
|
||||
}
|
||||
|
||||
if (resultH > 0.0) {
|
||||
tags.add("hdist");
|
||||
}
|
||||
@@ -198,9 +210,22 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
|
||||
resultV *= 100.0; // Normalize to % of a block.
|
||||
// Sometimes resultV can be up to 78
|
||||
if (Bridge1_9.isGliding(player) && (Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && resultV<60.0) {
|
||||
resultV = 0.0;
|
||||
}
|
||||
if (resultV > 0.0) {
|
||||
tags.add("vdist");
|
||||
}
|
||||
|
||||
if (!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");
|
||||
}
|
||||
|
||||
final double result = Math.max(0.0, resultH) + Math.max(0.0, resultV);
|
||||
|
||||
@@ -315,14 +340,23 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
else {
|
||||
// (Ignore sprinting here).
|
||||
final double attrMod = attributeAccess.getHandle().getSpeedAttributeMultiplier(player);
|
||||
if (attrMod != Double.MAX_VALUE) fSpeed *= attrMod;
|
||||
fSpeed *= data.walkSpeed / Magic.DEFAULT_WALKSPEED;
|
||||
}
|
||||
}
|
||||
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 (!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);
|
||||
|
||||
@@ -27,6 +27,8 @@ import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.collision.Axis;
|
||||
@@ -165,7 +167,7 @@ public class Passable extends Check {
|
||||
rayTracing.setIgnoreInitiallyColliding(false);
|
||||
//rayTracing.setCutOppositeDirectionMargin(false);
|
||||
//getEyeHeight() is a way to check isSwimming but not in water
|
||||
if (rayTracing.collides() && !player.isSwimming() && !player.isGliding() && !(player.getEyeHeight()<0.45)) {
|
||||
if (rayTracing.collides() && !Bridge1_13.isSwimming(player) && !Bridge1_9.isGliding(player) && !(player.getEyeHeight()<0.45)) {
|
||||
tags = "raytracing_collide_";
|
||||
}
|
||||
else if (rayTracing.getStepsDone() >= rayTracing.getMaxSteps()) {
|
||||
|
||||
+229
-63
@@ -19,11 +19,17 @@ import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Levelled;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
@@ -43,6 +49,7 @@ import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.VelocityFlags;
|
||||
import fr.neatmonster.nocheatplus.checks.workaround.WRPT;
|
||||
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;
|
||||
@@ -54,6 +61,7 @@ import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.CheckUtils;
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.count.ActionAccumulator;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
@@ -313,7 +321,7 @@ public class SurvivalFly extends Check {
|
||||
data.bunnyhopDelay--; // TODO: Design to do the changing at the bottom? [if change: check limits in bunnyHop(...)]
|
||||
|
||||
// Set flag for swimming with the flowing direction of liquid.
|
||||
thisMove.downStream = hDistance > thisMove.walkSpeed * Magic.modSwim && thisMove.from.inLiquid && from.isDownStream(xDistance, zDistance);
|
||||
thisMove.downStream = hDistance > (Bridge1_13.isSwimming(player) ? thisMove.walkSpeed * Magic.modSwim[1] : thisMove.walkSpeed * Magic.modSwim[0]) && thisMove.from.inLiquid && from.isDownStream(xDistance, zDistance);
|
||||
|
||||
// Handle ice.
|
||||
// TODO: Re-model ice stuff and other (e.g. general thing: ground-modifier + reset conditions).
|
||||
@@ -335,12 +343,16 @@ public class SurvivalFly extends Check {
|
||||
// TODO: Remove these local variables ?
|
||||
double hAllowedDistance = 0.0, hDistanceAboveLimit = 0.0, hFreedom = 0.0;
|
||||
if (hasHdist) {
|
||||
final double attrMod = attributeAccess.getHandle().getSpeedAttributeMultiplier(player);
|
||||
// Check allowed vs. taken horizontal distance.
|
||||
// Get the allowed distance.
|
||||
hAllowedDistance = setAllowedhDist(player, sprinting, thisMove, data, cc, pData, from, false);
|
||||
// Judge if horizontal speed is above limit.
|
||||
hDistanceAboveLimit = hDistance - hAllowedDistance;
|
||||
|
||||
if ((Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && hDistanceAboveLimit < 3.0) {
|
||||
hDistanceAboveLimit =0;
|
||||
}
|
||||
// Velocity, buffers and after failure checks.
|
||||
if (hDistanceAboveLimit > 0) {
|
||||
// TODO: Move more of the workarounds (buffer, bunny, ...) into this method.
|
||||
@@ -405,7 +417,7 @@ public class SurvivalFly extends Check {
|
||||
if (hDistanceAboveLimit <= 0D && hDistance > 0.1D && yDistance == 0D && !toOnGround && !fromOnGround
|
||||
&& lastMove.toIsValid && lastMove.yDistance == 0D
|
||||
&& BlockProperties.isLiquid(to.getTypeId()) && BlockProperties.isLiquid(from.getTypeId())
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed() && !player.isSwimming() // TODO: Might decrease margin here.
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed() && !Bridge1_13.isSwimming(player) // TODO: Might decrease margin here.
|
||||
) {
|
||||
// TODO: Relative hdistance.
|
||||
// TODO: Might check actual bounds (collidesBlock). Might implement + use BlockProperties.getCorrectedBounds or getSomeHeight.
|
||||
@@ -414,34 +426,74 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
|
||||
// Detects walking directly above water
|
||||
Material blockUnder = player.getLocation().subtract(0, 0.12, 0).getBlock().getType();
|
||||
Material blockAbove = player.getLocation().add(0, 0.10, 0).getBlock().getType();
|
||||
if (blockUnder != null && blockAbove != null) {
|
||||
// Checks if the player is above water but not in water.
|
||||
if (blockUnder == Material.WATER && blockAbove == Material.AIR) {
|
||||
// hDist and vDist checks, simply checks for horizontal movement with little y distance
|
||||
if (hDistanceAboveLimit <= 0D && hDistance > 0.11D && yDistance <= 0.1D && !toOnGround && !fromOnGround
|
||||
&& lastMove.toIsValid && lastMove.yDistance == yDistance || lastMove.yDistance == yDistance * -1 && lastMove.yDistance != 0D
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed() && !player.isSwimming()) {
|
||||
// Prevent being flagged if a player transitions from a block to water and the player falls into the water.
|
||||
if (!(yDistance < 0 && yDistance != 0 && lastMove.yDistance < 0 && lastMove.yDistance != 0)) {
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
tags.add("watermove");
|
||||
}
|
||||
}
|
||||
Block blockUnder = player.getLocation().subtract(0, 0.3, 0).getBlock();
|
||||
Material blockAbove = player.getLocation().add(0, 0.10, 0).getBlock().getType();
|
||||
if (blockUnder != null && blockAbove != null && blockUnder.getType().toString().endsWith("WATER")) {
|
||||
// Checks if the player is above water but not in water.
|
||||
// Much more effective than hspeed check
|
||||
if (!(data.timeRiptiding + 2500 > now) && from.isInLiquid() && Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) {
|
||||
double threshold = data.liqtick < 35 ? 0.4 : 0.165;
|
||||
if (Bridge1_13.hasIsSwimming()) {
|
||||
if (Bridge1_13.isSwimming(player)) threshold += 0.05; else threshold += 0.03;
|
||||
}
|
||||
final int level = BridgeEnchant.getDepthStriderLevel(player);
|
||||
threshold += level * 0.03;
|
||||
// Apply if moving to quickly from ground to water or having DepthStrider
|
||||
if (attrMod != Double.MAX_VALUE) {
|
||||
if (data.liqtick < 35 || level > 0) threshold *= attrMod;
|
||||
}
|
||||
if (Math.sqrt(TrigUtil.distanceSquared(from.getX(), from.getZ(), to.getX(), to.getZ())) > threshold) {
|
||||
data.watermovect += 2;
|
||||
if (data.watermovect > 7) {
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
tags.add("watermove(2)");
|
||||
}
|
||||
} else {
|
||||
data.watermovect = data.watermovect > 0 ? data.watermovect - 1 : 0;
|
||||
}
|
||||
}
|
||||
if (blockAbove == Material.AIR) {
|
||||
//Bouncing on water
|
||||
if (hDistanceAboveLimit <= 0D && hDistance > (Bridge1_13.hasDolphinGrace() ? 0.18D : 0.12D)
|
||||
&& !Bridge1_9.isGliding(player) && !Bridge1_13.isRiptiding(player)
|
||||
&& Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player)) && !toOnGround && !fromOnGround && (attrMod == Double.MAX_VALUE || attrMod <= 1.0)
|
||||
&& (from.getY() < to.getY()) && !(lastMove.from.inLiquid && !to.isInLiquid())
|
||||
&& !lastMove.from.onGround && !standsOnEntity(player,from.getY())
|
||||
&& lastMove.toIsValid && !from.isHeadObstructed() && !to.isHeadObstructed() && !Bridge1_13.isSwimming(player)) {
|
||||
boolean tag = false;
|
||||
if (Bridge1_13.hasIsSwimming()) {
|
||||
if (((Levelled)blockUnder.getBlockData()).getLevel() == 0) tag = true;
|
||||
} else if (blockUnder.getData() == 0) tag = true;
|
||||
if (tag) {
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
tags.add("waterjump");
|
||||
}
|
||||
}
|
||||
// hDist and vDist checks, simply checks for horizontal movement with little y distance
|
||||
if (hDistanceAboveLimit <= 0D && hDistance > 0.11D && yDistance <= 0.1D && !toOnGround && !fromOnGround
|
||||
&& lastMove.toIsValid && lastMove.yDistance == yDistance || lastMove.yDistance == yDistance * -1 && lastMove.yDistance != 0D
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed() && !Bridge1_13.isSwimming(player)) {
|
||||
// Prevent being flagged if a player transitions from a block to water and the player falls into the water.
|
||||
if (!(yDistance < 0 && yDistance != 0 && lastMove.yDistance < 0 && lastMove.yDistance != 0)) {
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
tags.add("watermove");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent players from sprinting if they're moving backwards (allow buffers to cover up !?).
|
||||
if (sprinting && data.lostSprintCount == 0 && hDistance > thisMove.walkSpeed && !data.hasActiveHorVel() && !player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||
// (Ignore some cases, in order to prevent false positives.)
|
||||
// TODO: speed effects ?
|
||||
if (TrigUtil.isMovingBackwards(xDistance, zDistance, from.getYaw())
|
||||
&& !pData.hasPermission(Permissions.MOVING_SURVIVALFLY_SPRINTING, player)) {
|
||||
// (Might have to account for speeding permissions.)
|
||||
// TODO: hDistance is too harsh?
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
tags.add("sprintback"); // Might add it anyway.
|
||||
// Prevent players from sprinting if they're moving backwards (allow buffers to cover up !?).
|
||||
if (sprinting && data.lostSprintCount == 0 && hDistance > thisMove.walkSpeed && !data.hasActiveHorVel() && !player.hasPotionEffect(PotionEffectType.SPEED) && (attrMod == Double.MAX_VALUE || attrMod <= 1.0)
|
||||
&& !((from.isInWater() || isWaterlogged(from) || player.getLocation().subtract(0.0, 0.3, 0.0).getBlock().getType() == Material.WATER) && !Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player)))) {
|
||||
// (Ignore some cases, in order to prevent false positives.)
|
||||
// TODO: speed effects ?
|
||||
if (TrigUtil.isMovingBackwards(xDistance, zDistance, from.getYaw())
|
||||
&& !pData.hasPermission(Permissions.MOVING_SURVIVALFLY_SPRINTING, player)) {
|
||||
// (Might have to account for speeding permissions.)
|
||||
// TODO: hDistance is too harsh?
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
if (hDistanceAboveLimit < 0.5) {hDistanceAboveLimit =0.0;}
|
||||
tags.add("sprintback"); // Might add it anyway.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -461,6 +513,8 @@ public class SurvivalFly extends Check {
|
||||
// Vertical move.
|
||||
//////////////////////////
|
||||
|
||||
if (fromOnGround || from.isInLiquid() || from.isInWeb() || from.isOnClimbable() || resetFrom || resetTo) data.yDis = 0.0;
|
||||
|
||||
// Calculate the vertical speed limit based on the current jump phase.
|
||||
double vAllowedDistance = 0, vDistanceAboveLimit = 0;
|
||||
// Distinguish certain media.
|
||||
@@ -496,7 +550,7 @@ public class SurvivalFly extends Check {
|
||||
final double[] res = vDistLiquid(from, to, toOnGround, yDistance, lastMove, data, player);
|
||||
vAllowedDistance = res[0];
|
||||
vDistanceAboveLimit = res[1];
|
||||
if (vDistanceAboveLimit <= 0.0 && yDistance > 0.0 && Math.abs(yDistance) > Magic.swimBaseSpeedV()) {
|
||||
if (vDistanceAboveLimit <= 0.0 && yDistance > 0.0 && Math.abs(yDistance) > Magic.swimBaseSpeedV(Bridge1_13.isSwimming(player))) {
|
||||
data.setFrictionJumpPhase();
|
||||
}
|
||||
}
|
||||
@@ -898,21 +952,24 @@ public class SurvivalFly extends Check {
|
||||
double friction = data.lastFrictionHorizontal; // Friction to use with this move.
|
||||
// TODO: sfDirty: Better friction/envelope-based.
|
||||
boolean useBaseModifiers = false;
|
||||
boolean useBaseModifiersSprint = true;
|
||||
if (thisMove.from.inWeb) {
|
||||
data.sfOnIce = 0;
|
||||
// TODO: if (from.isOnIce()) <- makes it even slower !
|
||||
// Does include sprinting by now (would need other accounting methods).
|
||||
hAllowedDistance = Magic.modWeb * thisMove.walkSpeed * cc.survivalFlyWalkingSpeed / 100D;
|
||||
friction = 0.0; // Ensure friction can't be used to speed.
|
||||
useBaseModifiers = true;
|
||||
}
|
||||
else if (thisMove.to.onSoulSand && thisMove.from.onSoulSand) {
|
||||
hAllowedDistance = Magic.modSoulSand * thisMove.walkSpeed * cc.survivalFlyWalkingSpeed / 100D;
|
||||
useBaseModifiers = true;
|
||||
}
|
||||
else if (thisMove.from.inLiquid && thisMove.to.inLiquid) {
|
||||
// Check all liquids (lava might demand even slower speed though).
|
||||
// TODO: Test how to go with only checking from (less dolphins).
|
||||
// TODO: Sneaking and blocking applies to when in water !
|
||||
hAllowedDistance = Magic.modSwim * thisMove.walkSpeed * cc.survivalFlySwimmingSpeed / 100D;
|
||||
hAllowedDistance = Bridge1_13.isSwimming(player) ? Magic.modSwim[1] : Magic.modSwim[0] * thisMove.walkSpeed * cc.survivalFlySwimmingSpeed / 100D;
|
||||
useBaseModifiers = true;
|
||||
if (thisMove.from.inWater || !thisMove.from.inLava) { // (We don't really have other liquids, though.)
|
||||
final int level = BridgeEnchant.getDepthStriderLevel(player);
|
||||
@@ -920,31 +977,31 @@ public class SurvivalFly extends Check {
|
||||
// The hard way.
|
||||
hAllowedDistance *= Magic.modDepthStrider[level];
|
||||
// Modifiers: Most speed seems to be reached on ground, but couldn't nail down.
|
||||
} else if (player.hasPotionEffect(PotionEffectType.DOLPHINS_GRACE)) {
|
||||
} else if (!Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) {
|
||||
// TODO: Allow for faster swimming above water with Dolhphins Grace
|
||||
hAllowedDistance *= Magic.modDolphinsGrace;
|
||||
} if (level > 0 && player.hasPotionEffect(PotionEffectType.DOLPHINS_GRACE)) {
|
||||
} if (level > 0 && !Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) {
|
||||
hAllowedDistance *= Magic.modDepthStrider[level] * Magic.modDolphinsGrace * 4;
|
||||
} if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
hAllowedDistance *= Magic.modRiptide;
|
||||
} if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
hAllowedDistance *= Magic.modRiptide[data.RiptideLevel];
|
||||
}
|
||||
}
|
||||
// (Friction is used as is.)
|
||||
} else if (data.newHDist && hAllowedDistance < 0.345D) {
|
||||
// (Friction is used as is.)
|
||||
} else if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
hAllowedDistance = Magic.modRiptide[data.RiptideLevel] * thisMove.walkSpeed * cc.survivalFlySpeedingSpeed / 100D;
|
||||
} else if (data.newHDist && hAllowedDistance < 0.345D) {
|
||||
useBaseModifiers = true;
|
||||
hAllowedDistance = 0.445D;
|
||||
|
||||
} else if (snowFix && hAllowedDistance < 0.377D) {
|
||||
hAllowedDistance = 0.377D;
|
||||
useBaseModifiers = true;
|
||||
}
|
||||
else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
hAllowedDistance = Magic.modRiptide * thisMove.walkSpeed * cc.survivalFlySpeedingSpeed / 100D;
|
||||
}
|
||||
// Allows faster speed for player when swimming above water since from -> to does not seem to detect correctly
|
||||
else if ((BlockProperties.isLiquid(from.getTypeIdBelow()) || BlockProperties.isNewLiq(from.getTypeIdBelow()) && player.hasPotionEffect(PotionEffectType.DOLPHINS_GRACE))) {
|
||||
hAllowedDistance = Magic.modSwim * thisMove.walkSpeed * cc.survivalFlySwimmingSpeed * Magic.modDolphinsGrace / 100D;
|
||||
else if ((BlockProperties.isLiquid(from.getTypeIdBelow()) || BlockProperties.isNewLiq(from.getTypeIdBelow()) && !Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player)))) {
|
||||
hAllowedDistance = Bridge1_13.isSwimming(player) ? Magic.modSwim[1] : Magic.modSwim[0] * thisMove.walkSpeed * cc.survivalFlySwimmingSpeed * Magic.modDolphinsGrace / 100D;
|
||||
final int level = BridgeEnchant.getDepthStriderLevel(player);
|
||||
if (level > 0) {
|
||||
hAllowedDistance = Magic.modSwim * thisMove.walkSpeed * cc.survivalFlySwimmingSpeed * Magic.modDolphinsGrace * Magic.modDepthStrider[level] / 100D;
|
||||
hAllowedDistance = Magic.modSwim[0] * thisMove.walkSpeed * cc.survivalFlySwimmingSpeed * Magic.modDolphinsGrace * Magic.modDepthStrider[level] / 100D;
|
||||
}
|
||||
}
|
||||
// TODO: !sfDirty is very coarse, should use friction instead.
|
||||
@@ -952,13 +1009,19 @@ public class SurvivalFly extends Check {
|
||||
&& (!checkPermissions || !pData.hasPermission(Permissions.MOVING_SURVIVALFLY_SNEAKING, player))) {
|
||||
hAllowedDistance = Magic.modSneak * thisMove.walkSpeed * cc.survivalFlySneakingSpeed / 100D;
|
||||
friction = 0.0; // Ensure friction can't be used to speed.
|
||||
useBaseModifiers = true;
|
||||
useBaseModifiersSprint = false;
|
||||
// TODO: Attribute modifiers can count in here, e.g. +0.5 (+ 50% doesn't seem to pose a problem, neither speed effect 2).
|
||||
}
|
||||
// TODO: !sfDirty is very coarse, should use friction instead.
|
||||
else if (!sfDirty && thisMove.from.onGround && player.isBlocking()
|
||||
// Find out why it didn't flag immediately
|
||||
else if (!sfDirty && thisMove.from.onGround && (data.isusingitem || data.isHackingRI || player.isBlocking())
|
||||
&& (!checkPermissions || !pData.hasPermission(Permissions.MOVING_SURVIVALFLY_BLOCKING, player))) {
|
||||
data.isHackingRI = false;
|
||||
hAllowedDistance = Magic.modBlock * thisMove.walkSpeed * cc.survivalFlyBlockingSpeed / 100D;
|
||||
friction = 0.0; // Ensure friction can't be used to speed.
|
||||
useBaseModifiers = true;
|
||||
useBaseModifiersSprint = false;
|
||||
}
|
||||
else {
|
||||
useBaseModifiers = true;
|
||||
@@ -974,7 +1037,7 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
// Apply modifiers (sprinting, attributes, ...).
|
||||
if (useBaseModifiers) {
|
||||
if (sprinting) {
|
||||
if (useBaseModifiersSprint && sprinting) {
|
||||
hAllowedDistance *= data.multSprinting;
|
||||
}
|
||||
// Note: Attributes count in slowness potions, thus leaving out isn't possible.
|
||||
@@ -1010,7 +1073,7 @@ public class SurvivalFly extends Check {
|
||||
// Account for flowing liquids (only if needed).
|
||||
// Assume: If in liquids this would be placed right here.
|
||||
if (thisMove.downStream) {
|
||||
hAllowedDistance *= Magic.modDownStream;
|
||||
hAllowedDistance *= Bridge1_13.isSwimming(player) ? Magic.modDownStream2 : Magic.modDownStream;
|
||||
}
|
||||
|
||||
// If the player is on ice, give them a higher maximum speed.
|
||||
@@ -1098,6 +1161,13 @@ public class SurvivalFly extends Check {
|
||||
// Change seen from last yDistance.
|
||||
final double yDistChange = lastMove.toIsValid ? yDistance - lastMove.yDistance : Double.MAX_VALUE;
|
||||
|
||||
final double dis = TrigUtil.xzDistance(from, to);
|
||||
if (dis < 0.2 && yDistance > 0.2) {
|
||||
data.yDis += yDistance;
|
||||
if (data.yDis <0.0 || data.yDis > 257.0) {
|
||||
data.yDis = 0.0;
|
||||
}
|
||||
}
|
||||
// Hacks.
|
||||
final boolean envelopeHack;
|
||||
if (!resetFrom && !resetTo && MagicAir.venvHacks(from, to, yDistance, yDistChange, thisMove, lastMove, data)) {
|
||||
@@ -1150,7 +1220,7 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
}
|
||||
strictVdistRel = false;
|
||||
} else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
} else if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
vAllowedDistance = lastMove.yDistance * 5.0D;
|
||||
strictVdistRel = false;
|
||||
} else if (data.bedLeaveTime + 500 > now && yDistance < 0.45) {
|
||||
@@ -1228,6 +1298,13 @@ public class SurvivalFly extends Check {
|
||||
// Odd decrease with water.
|
||||
}
|
||||
else if (MagicAir.oddJunction(from, to, yDistance, yDistChange, yDistDiffEx, maxJumpGain, resetTo, thisMove, lastMove, data, cc)) {
|
||||
// A quick fix for 4.5 block height jesus bypass
|
||||
// TODO: should fix data.isVelocityJumpPhase() instead
|
||||
if (data.liftOffEnvelope == LiftOffEnvelope.LIMIT_LIQUID) {
|
||||
if (yDistance > 0.0 && yDistance > (Bridge1_13.hasIsSwimming() ? 0.3 : 0.155)) {
|
||||
vDistRelVL = true;
|
||||
}
|
||||
}
|
||||
// Several types of odd in-air moves, mostly with gravity near maximum, friction, medium change.
|
||||
}
|
||||
else if (yDistDiffEx < 0.025
|
||||
@@ -1238,9 +1315,9 @@ public class SurvivalFly extends Check {
|
||||
* slightly above the top.
|
||||
*/
|
||||
}
|
||||
else if (BlockProperties.isNewLiq(from.getTypeIdBelowLiq())) {
|
||||
else if (BlockProperties.isNewLiq(from.getTypeIdBelowLiq()) || isLanternUpper(to) || isWaterlogged(from)) {
|
||||
|
||||
} else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
} else if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
vDistRelVL = false;
|
||||
} else if (data.bedLeaveTime + 500 > now && yDistance < 0.45) {
|
||||
vDistRelVL = false;
|
||||
@@ -1280,7 +1357,7 @@ public class SurvivalFly extends Check {
|
||||
// Allow too strong decrease.
|
||||
// TODO: Another magic check here? Route most checks through methods anyway?
|
||||
}
|
||||
else if (BlockProperties.isNewLiq(from.getTypeIdBelowLiq())) {
|
||||
else if (BlockProperties.isNewLiq(from.getTypeIdBelowLiq()) || isLanternUpper(to)) {
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -1320,10 +1397,10 @@ public class SurvivalFly extends Check {
|
||||
else if (lastMove.toIsValid && MagicAir.oddJunction(from, to, yDistance, yDistChange, yDistDiffEx, maxJumpGain, resetTo, thisMove, lastMove, data, cc)) {
|
||||
// Several types of odd in-air moves, mostly with gravity near maximum, friction, medium change.
|
||||
}
|
||||
else if (BlockProperties.isNewLiq(from.getTypeIdBelowLiq())) {
|
||||
else if (BlockProperties.isNewLiq(from.getTypeIdBelowLiq()) || isLanternUpper(to)) {
|
||||
|
||||
}
|
||||
else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
else if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
vDistRelVL = false;
|
||||
} else if (data.bedLeaveTime + 500 > now && yDistance < 0.45) {
|
||||
vDistRelVL = false;
|
||||
@@ -1334,6 +1411,14 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
// else Accept small aberrations !?
|
||||
}
|
||||
if (data.yDis > (Bridge1_13.hasIsSwimming() ? 1.37 : 1.245)
|
||||
&& !data.isVelocityJumpPhase()
|
||||
&& data.timeRiptiding + 3500 < now
|
||||
&& Double.isInfinite(PotionUtil.getPotionEffectAmplifier(player, PotionEffectType.JUMP))) {
|
||||
vDistanceAboveLimit = 1.37;
|
||||
vDistRelVL = true;
|
||||
data.yDis -= 1.0;
|
||||
}
|
||||
|
||||
if (vDistRelVL) {
|
||||
if (data.getOrUseVerticalVelocity(yDistance) == null) {
|
||||
@@ -1363,9 +1448,12 @@ public class SurvivalFly extends Check {
|
||||
else if (Magic.skipPaper(thisMove, lastMove, data)) {
|
||||
// Tag already set above.
|
||||
}
|
||||
else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
else if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
tags.add("yriptide");
|
||||
}
|
||||
else if (Bridge1_13.isSwimming(player) && isWaterlogged(from)) {
|
||||
// Ignore water logged blocks
|
||||
}
|
||||
// Attempt to use velocity.
|
||||
else if (data.getOrUseVerticalVelocity(yDistance) == null) {
|
||||
// Violation.
|
||||
@@ -1418,7 +1506,7 @@ public class SurvivalFly extends Check {
|
||||
if (yDistance < 0.5) {
|
||||
// Ignore falling, and let accounting deal with it.
|
||||
}
|
||||
else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
else if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
|
||||
}
|
||||
|
||||
@@ -1517,7 +1605,7 @@ public class SurvivalFly extends Check {
|
||||
else if (thisMove.verVelUsed == null) { // Only skip if just used.
|
||||
// Here yDistance can be negative and positive.
|
||||
// if (yDistance != 0.0) {
|
||||
if ( (BlockProperties.isNewLiq(from.getTypeIdBelow())) || (data.timeRiptiding + 500 > now) || (data.bedLeaveTime + 500 > now && yDistance < 0.45) || (snowFix) ) {
|
||||
if ( (BlockProperties.isNewLiq(from.getTypeIdBelow())) || (data.timeRiptiding + 500 > now) || (data.bedLeaveTime + 500 > now && yDistance < 0.45) || (snowFix) || isLanternUpper(to) || isWaterlogged(from)) {
|
||||
// Ignore
|
||||
}
|
||||
else {
|
||||
@@ -1539,6 +1627,53 @@ public class SurvivalFly extends Check {
|
||||
return vDistanceAboveLimit;
|
||||
}
|
||||
|
||||
private boolean standsOnEntity(final Entity entity, final double minY){
|
||||
// TODO: Probably check other ids too before doing this ?
|
||||
for (final Entity other : entity.getNearbyEntities(1.5, 1.0, 1.5)){
|
||||
final EntityType type = other.getType();
|
||||
if (type != EntityType.BOAT){
|
||||
continue;
|
||||
}
|
||||
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))){
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isLanternUpper(PlayerLocation from) {
|
||||
World w = from.getWorld();
|
||||
final int x = from.getBlockX();
|
||||
final int y = from.getBlockY() + 2;
|
||||
final int z = from.getBlockZ();
|
||||
if (w.getBlockAt(x, y, z).getType().toString().equals("LANTERN")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isWaterlogged(PlayerLocation from) {
|
||||
if (!Bridge1_13.hasIsSwimming()) return false;
|
||||
World w = from.getWorld();
|
||||
final int x = from.getBlockX();
|
||||
final int y = from.getBlockY();
|
||||
final int z = from.getBlockZ();
|
||||
BlockData bd = w.getBlockAt(x,y-1,z).getBlockData();
|
||||
if (bd instanceof Waterlogged) {
|
||||
return ((Waterlogged)bd).isWaterlogged();
|
||||
}
|
||||
BlockData bd2 = w.getBlockAt(x,y,z).getBlockData();
|
||||
if (bd2 instanceof Waterlogged) {
|
||||
return ((Waterlogged)bd2).isWaterlogged();
|
||||
}
|
||||
BlockData bd4 = w.getBlockAt(x,y+2,z).getBlockData();
|
||||
if (bd4 instanceof Waterlogged) {
|
||||
return ((Waterlogged)bd4).isWaterlogged();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Demand that with time the values decrease.<br>
|
||||
* The ActionAccumulator instance must have 3 buckets, bucket 1 is checked against
|
||||
@@ -1606,7 +1741,7 @@ public class SurvivalFly extends Check {
|
||||
// Moving upwards after falling without having touched the ground.
|
||||
if (data.bunnyhopDelay < 9 && !((lastMove.touchedGround || lastMove.from.onGroundOrResetCond) && lastMove.yDistance == 0D) && data.getOrUseVerticalVelocity(yDistance) == null) {
|
||||
// TODO: adjust limit for bunny-hop.
|
||||
if ( (BlockProperties.isNewLiq(from.getTypeIdBelow())) || (data.timeRiptiding + 500 > now) || (data.bedLeaveTime + 500 > now && yDistance < 0.45) || (snowFix) ) {
|
||||
if ( (BlockProperties.isNewLiq(from.getTypeIdBelow())) || (data.timeRiptiding + 500 > now) || (data.bedLeaveTime + 500 > now && yDistance < 0.45) || (snowFix) || (isLanternUpper(to))) {
|
||||
|
||||
} else {
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance));
|
||||
@@ -1688,13 +1823,13 @@ public class SurvivalFly extends Check {
|
||||
hDistanceAboveLimit = bunnyHop(from, to, hAllowedDistance, hDistanceAboveLimit, sprinting, thisMove, lastMove, data, cc);
|
||||
|
||||
// After failure permission checks ( + speed modifier + sneaking + blocking + speeding) and velocity (!).
|
||||
if (hDistanceAboveLimit > 0.12 && !skipPermChecks && !thisMove.from.inLiquid && !thisMove.to.inLiquid && !player.hasPotionEffect(PotionEffectType.DOLPHINS_GRACE)) {
|
||||
if (hDistanceAboveLimit > 0.12 && !skipPermChecks && !thisMove.from.inLiquid && !thisMove.to.inLiquid && Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) {
|
||||
// TODO: Most cases these will not apply. Consider redesign to do these last or checking right away and skip here on some conditions.
|
||||
hAllowedDistance = setAllowedhDist(player, sprinting, thisMove, data, cc, pData, from, true);
|
||||
hDistanceAboveLimit = thisMove.hDistance - hAllowedDistance;
|
||||
tags.add("permchecks-outliq");
|
||||
}
|
||||
if (hDistanceAboveLimit > 0.6 && !skipPermChecks && thisMove.from.inLiquid && thisMove.to.inLiquid && player.hasPotionEffect(PotionEffectType.DOLPHINS_GRACE)) {
|
||||
if (hDistanceAboveLimit > 0.6 && !skipPermChecks && thisMove.from.inLiquid && thisMove.to.inLiquid && !Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) {
|
||||
hAllowedDistance = setAllowedhDist(player, sprinting, thisMove, data, cc, pData, from, true);
|
||||
hDistanceAboveLimit = thisMove.hDistance - hAllowedDistance;
|
||||
tags.add("permchecks-inliq");
|
||||
@@ -1760,7 +1895,10 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 3000 > now)) {
|
||||
if (Bridge1_9.isGliding(player) && hDistanceAboveLimit< 0.5) {
|
||||
hDistanceAboveLimit=0.0;
|
||||
}
|
||||
tags.add("hriptide");
|
||||
}
|
||||
|
||||
@@ -1981,9 +2119,9 @@ public class SurvivalFly extends Check {
|
||||
// Expected envelopes.
|
||||
final double baseSpeed;
|
||||
if (player.isOnGround()) {
|
||||
baseSpeed = Magic.swimBaseSpeedV() + 0.1;
|
||||
baseSpeed = Magic.swimBaseSpeedV(Bridge1_13.isSwimming(player)) + 0.1;
|
||||
} else {
|
||||
baseSpeed = Magic.swimBaseSpeedV(); } // TODO: Lava?
|
||||
baseSpeed = Magic.swimBaseSpeedV(Bridge1_13.isSwimming(player)); } // TODO: Lava?
|
||||
final double yDistAbs = Math.abs(yDistance);
|
||||
|
||||
// TODO: Later also cover things like a sudden stop.
|
||||
@@ -2016,14 +2154,18 @@ public class SurvivalFly extends Check {
|
||||
return new double[]{yDistance, 0.0};
|
||||
}
|
||||
|
||||
if (player.isRiptiding() || (data.timeRiptiding + 1000 > now)) {
|
||||
if (Bridge1_13.isRiptiding(player) || (data.timeRiptiding + 1000 > now)) {
|
||||
return new double[]{yDistance, 0.0};
|
||||
}
|
||||
|
||||
// TODO: Set magic speeds
|
||||
if (from.getTypeId() == Material.BUBBLE_COLUMN) {
|
||||
if (isBubbleColumn(from)) {
|
||||
return new double[]{yDistance, 0.0};
|
||||
}
|
||||
|
||||
if (Bridge1_13.hasIsSwimming() && yDistance > 0.0 && from.isOnGround()) {
|
||||
return new double[]{yDistance, 0.0};
|
||||
}
|
||||
|
||||
// At this point a violation.
|
||||
tags.add(yDistance < 0.0 ? "swimdown" : "swimup");
|
||||
@@ -2037,6 +2179,26 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isBubbleColumn(PlayerLocation from) {
|
||||
if (!Bridge1_13.hasIsSwimming()) return false;
|
||||
if (from.getTypeId() == 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* On-climbable vertical distance checking.
|
||||
* @param from
|
||||
@@ -2080,6 +2242,10 @@ public class SurvivalFly extends Check {
|
||||
tags.add("climbspeed");
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance) - maxSpeed);
|
||||
}
|
||||
long now = System.currentTimeMillis();
|
||||
if ((Bridge1_13.isRiptiding(player) || data.timeRiptiding + 3000 > now) && vDistanceAboveLimit< 4.0) {
|
||||
vDistanceAboveLimit = 0.0;
|
||||
}
|
||||
}
|
||||
if (yDistance > 0) {
|
||||
if (!data.playerMoves.getCurrentMove().touchedGround) {
|
||||
|
||||
+4
@@ -219,6 +219,7 @@ public class VehicleChecks extends CheckListener {
|
||||
debug(player, "onPlayerMoveVehicle: vehicle: " + vehicle);
|
||||
}
|
||||
data.wasInVehicle = true;
|
||||
data.waspreInVehicle = true;
|
||||
data.sfHoverTicks = -1;
|
||||
data.removeAllVelocity();
|
||||
data.sfLowJump = false;
|
||||
@@ -727,6 +728,9 @@ public class VehicleChecks extends CheckListener {
|
||||
if (debug) {
|
||||
debug(player, "Vehicle enter: first vehicle: " + vehicle.getClass().getName());
|
||||
}
|
||||
|
||||
data.waspreInVehicle = true;
|
||||
|
||||
// Check for nested vehicles.
|
||||
final Entity lastVehicle = passengerUtil.getLastNonPlayerVehicle(vehicle, true);
|
||||
if (lastVehicle == null) {
|
||||
|
||||
+58
-5
@@ -17,12 +17,17 @@ package fr.neatmonster.nocheatplus.checks.moving.vehicle;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Pig;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
@@ -36,7 +41,10 @@ import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.VehicleMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.VehicleMoveInfo;
|
||||
import fr.neatmonster.nocheatplus.checks.workaround.WRPT;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
|
||||
@@ -168,9 +176,14 @@ public class VehicleEnvelope extends Check {
|
||||
final MovingData data, final MovingConfig cc,
|
||||
final boolean debug) {
|
||||
boolean violation = false;
|
||||
long now = System.currentTimeMillis();
|
||||
if (debug) {
|
||||
debugDetails.add("inair: " + data.sfJumpPhase);
|
||||
}
|
||||
|
||||
if (isBubbleColumn(vehicle.getLocation())) {
|
||||
data.timeVehicletoss = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// Medium dependent checking.
|
||||
|
||||
@@ -178,6 +191,12 @@ public class VehicleEnvelope extends Check {
|
||||
|
||||
// Maximum thinkable horizontal speed.
|
||||
// TODO: Further distinguish, best set in CheckDetails.
|
||||
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;
|
||||
} else
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc))) { // Override type for now.
|
||||
return true;
|
||||
}
|
||||
@@ -252,7 +271,7 @@ public class VehicleEnvelope extends Check {
|
||||
}
|
||||
else if (checkDetails.inAir) {
|
||||
// In-air move.
|
||||
if (checkInAir(thisMove, data, debug)) {
|
||||
if (checkInAir(thisMove, data, debug, vehicle)) {
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
@@ -268,11 +287,23 @@ public class VehicleEnvelope extends Check {
|
||||
// TODO: At least do something here?
|
||||
}
|
||||
}
|
||||
if (vehicle instanceof LivingEntity) {
|
||||
Double levitation = Bridge1_9.getLevitationAmplifier((LivingEntity)vehicle);
|
||||
if (!Double.isInfinite(levitation)) {
|
||||
checkDetails.maxAscend += 0.046 * (levitation + 1);
|
||||
violation = false;
|
||||
}
|
||||
}
|
||||
// Maximum ascend speed.
|
||||
if (checkDetails.checkAscendMuch && thisMove.yDistance > checkDetails.maxAscend) {
|
||||
tags.add("ascend_much");
|
||||
violation = true;
|
||||
}
|
||||
|
||||
if (data.timeVehicletoss + 2000 > now && thisMove.yDistance < 4.0) {
|
||||
violation = false;
|
||||
}
|
||||
|
||||
// Maximum descend speed.
|
||||
if (checkDetails.checkDescendMuch && thisMove.yDistance < -MagicVehicle.maxDescend) {
|
||||
// TODO: At times it looks like one move is skipped, resulting in double distance ~ -5 and at the same time 'vehicle moved too quickly'.
|
||||
@@ -305,6 +336,26 @@ 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare checkDetails according to vehicle-specific interpretation of side
|
||||
@@ -359,7 +410,7 @@ public class VehicleEnvelope extends Check {
|
||||
// Generic settings.
|
||||
// (maxAscend is not checked for stepping up blocks)
|
||||
if (checkDetails.canJump) {
|
||||
checkDetails.maxAscend = 1.0; // Coarse envelope. Actual lift off gain should be checked on demand.
|
||||
checkDetails.maxAscend = 1.2; // Coarse envelope. Actual lift off gain should be checked on demand.
|
||||
}
|
||||
// Climbable
|
||||
if (checkDetails.canClimb) {
|
||||
@@ -381,7 +432,7 @@ public class VehicleEnvelope extends Check {
|
||||
* @return
|
||||
*/
|
||||
private boolean checkInAir(final VehicleMoveData thisMove, final MovingData data,
|
||||
final boolean debug) {
|
||||
final boolean debug, final Entity vehicle) {
|
||||
|
||||
// TODO: Distinguish sfJumpPhase and inAirDescendCount (after reaching the highest point).
|
||||
|
||||
@@ -417,8 +468,10 @@ public class VehicleEnvelope extends Check {
|
||||
final double maxDescend = getInAirMaxDescend(thisMove, data);
|
||||
if (data.sfJumpPhase > (checkDetails.canJump ? MagicVehicle.maxJumpPhaseAscend : 1)
|
||||
&& thisMove.yDistance > Math.max(minDescend, -checkDetails.gravityTargetSpeed)) {
|
||||
tags.add("slow_fall_vdist");
|
||||
violation = true;
|
||||
if (!(vehicle instanceof LivingEntity && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier((LivingEntity)vehicle)))) {
|
||||
tags.add("slow_fall_vdist");
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
// Fast falling (vdist).
|
||||
else if (data.sfJumpPhase > 1 && thisMove.yDistance < maxDescend) {
|
||||
|
||||
@@ -14,18 +14,35 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
|
||||
public class Bridge1_13 {
|
||||
private static final PotionEffectType SLOWFALLING = PotionEffectType.getByName("SLOW_FALLING");
|
||||
private static final PotionEffectType DOLPHINSGRACE = PotionEffectType.getByName("DOLPHINS_GRACE");
|
||||
private static final boolean hasIsRiptiding = ReflectionUtil.getMethodNoArgs(Player.class, "isRiptiding", boolean.class) != null;
|
||||
private static final boolean hasIsSwimming = ReflectionUtil.getMethodNoArgs(Player.class, "isSwimming", boolean.class) != null;
|
||||
|
||||
public static boolean hasSlowfalling() {
|
||||
return SLOWFALLING != null;
|
||||
}
|
||||
|
||||
public static boolean hasDolphinGrace() {
|
||||
return DOLPHINSGRACE != null;
|
||||
}
|
||||
|
||||
public static boolean hasIsRiptiding() {
|
||||
return hasIsRiptiding;
|
||||
}
|
||||
|
||||
public static boolean hasIsSwimming() {
|
||||
return hasIsSwimming;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for the 'slowfalling' potion effect.
|
||||
*
|
||||
@@ -38,4 +55,32 @@ public class Bridge1_13 {
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(player, SLOWFALLING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for the 'slowfalling' potion effect.
|
||||
*
|
||||
* @param LivingEntity
|
||||
* @return Double.NEGATIVE_INFINITY if not present.
|
||||
*/
|
||||
public static double getSlowfallingAmplifier(final LivingEntity entity) {
|
||||
if (SLOWFALLING == null) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(entity, SLOWFALLING);
|
||||
}
|
||||
|
||||
public static double getDolphinGraceAmplifier(final Player player) {
|
||||
if (DOLPHINSGRACE == null) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(player, DOLPHINSGRACE);
|
||||
}
|
||||
|
||||
public static boolean isRiptiding(final Player player) {
|
||||
return hasIsRiptiding ? player.isRiptiding() : false;
|
||||
}
|
||||
|
||||
public static boolean isSwimming(final Player player) {
|
||||
return hasIsSwimming ? player.isSwimming() : false;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
package fr.neatmonster.nocheatplus.compat;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
@@ -83,6 +84,19 @@ public class Bridge1_9 {
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(player, LEVITATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for the 'levitation' potion effect.
|
||||
*
|
||||
* @param player
|
||||
* @return Double.NEGATIVE_INFINITY if not present.
|
||||
*/
|
||||
public static double getLevitationAmplifier(final LivingEntity entity) {
|
||||
if (LEVITATION == null) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(entity, LEVITATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gliding + wearing elytra.
|
||||
|
||||
@@ -35,6 +35,8 @@ public final class BridgeEnchant {
|
||||
private final static Enchantment DEPTH_STRIDER = parseEnchantment("DEPTH_STRIDER");
|
||||
|
||||
private final static Enchantment THORNS = parseEnchantment("THORNS");
|
||||
|
||||
private final static Enchantment RIPTIDE = parseEnchantment("RIPTIDE");
|
||||
|
||||
/**
|
||||
* Retrieve the maximum level for an enchantment, present in armor slots.
|
||||
@@ -112,5 +114,34 @@ public final class BridgeEnchant {
|
||||
// Cap at three.
|
||||
return Math.min(3, getMaxLevelArmor(player, DEPTH_STRIDER));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the maximum level for an enchantment, present in main and off hand slot.
|
||||
*
|
||||
* @param player
|
||||
* @param enchantment
|
||||
* If null, 0 will be returned.
|
||||
* @return 0 if none found, or the maximum found.
|
||||
*/
|
||||
private static int getTrident(final Player player, final Enchantment enchantment) {
|
||||
if (enchantment == null) {
|
||||
return 0;
|
||||
}
|
||||
int level = 0;
|
||||
// Find the maximum level for the given enchantment.
|
||||
final ItemStack mainhand = player.getInventory().getItemInMainHand();
|
||||
final ItemStack offhand = player.getInventory().getItemInOffHand();
|
||||
if (mainhand.getType().toString().equals("TRIDENT")) {
|
||||
return Math.max(mainhand.getEnchantmentLevel(enchantment), level);
|
||||
}
|
||||
if (offhand.getType().toString().equals("TRIDENT")) {
|
||||
level = Math.max(offhand.getEnchantmentLevel(enchantment), level);
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
public static int getRiptideLevel(final Player player) {
|
||||
return Math.min(3, getTrident(player, RIPTIDE));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -276,7 +276,7 @@ public class BridgeMaterial {
|
||||
"repeating_command_block", "command_repeating");
|
||||
|
||||
/** Sign block. */
|
||||
public static final Material SIGN = getFirstNotNull("acacia_sign", "birch_sign", "dark_oak_sign", "jungle_sign", "oak_sign", "spruce_sign", "acacia_wall_sign", "birch_wall_sign", "dark_oak_wall_sign", "jungle_wall_sign", "oak_wall_sign", "spruce_wall_sign", "sign", "sign_post", "wall_sign");
|
||||
public static final Material SIGN = getFirstNotNull("acacia_sign", "birch_sign", "dark_oak_sign", "jungle_sign", "oak_sign", "spruce_sign", "acacia_wall_sign", "birch_wall_sign", "dark_oak_wall_sign", "jungle_wall_sign", "oak_wall_sign", "spruce_wall_sign", "sign_post", "sign", "wall_sign");
|
||||
|
||||
/** Some skull for reference. */
|
||||
public static final Material SKELETON_SKULL = getFirst("skeleton_skull", "skull");
|
||||
|
||||
+6
-1
@@ -36,7 +36,11 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
|
||||
@Override
|
||||
public void setupBlockProperties(WorldConfigProvider<?> worldConfigProvider) {
|
||||
|
||||
// Add flag for anvil
|
||||
BlockFlags.addFlags("ANVIL", BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
// Change flag for walls
|
||||
BlockFlags.addFlags("COBBLESTONE_WALL", BlockProperties.F_THICK_FENCE2);
|
||||
BlockFlags.removeFlags("COBBLESTONE_WALL", BlockProperties.F_THICK_FENCE);
|
||||
// Void air.
|
||||
BlockInit.setAs("VOID_AIR", Material.AIR);
|
||||
// Cave air.
|
||||
@@ -170,6 +174,7 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
|
||||
// Sea Pickle.
|
||||
BlockProperties.setBlockProps("SEA_PICKLE", BlockProperties.instantType);
|
||||
BlockFlags.addFlags("SEA_PICKLE", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
|
||||
// Turtle egg.
|
||||
BlockProperties.setBlockProps("TURTLE_EGG", new BlockProps(
|
||||
|
||||
+13
-15
@@ -23,7 +23,7 @@ public class BlocksMC1_14 implements BlockPropertiesSetup{
|
||||
// TODO Auto-generated method stub
|
||||
BlockFlags.addFlags("VINE", BlockProperties.F_CLIMBUPABLE);
|
||||
final long stepFlags = BlockProperties.F_GROUND | BlockProperties.F_XZ100 | BlockProperties.F_GROUND_HEIGHT;
|
||||
final long wall = BlockProperties.F_VARIABLE | BlockProperties.F_GROUND | BlockProperties.F_HEIGHT150 | BlockProperties.F_THICK_FENCE;
|
||||
final long wall = BlockProperties.F_VARIABLE | BlockProperties.F_GROUND | BlockProperties.F_HEIGHT150 | BlockProperties.F_THICK_FENCE2;
|
||||
final BlockProperties.BlockProps instant = BlockProperties.instantType;
|
||||
BlockInit.setPropsAs("END_STONE_BRICK_WALL", BridgeMaterial.END_STONE_BRICKS);
|
||||
BlockFlags.addFlags("END_STONE_BRICK_WALL", wall);
|
||||
@@ -103,23 +103,20 @@ public class BlocksMC1_14 implements BlockPropertiesSetup{
|
||||
BlockInit.setAs("JIGSAW", BridgeMaterial.COMMAND_BLOCK);
|
||||
BlockInit.setAs("BLAST_FURNACE", Material.FURNACE);
|
||||
BlockInit.setAs("SMOKER", Material.FURNACE);
|
||||
BlockInit.setAs("COMPOSTER", Material.DIRT);
|
||||
BlockProperties.setBlockProps("COMPOSTER", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.7f, BlockProperties.secToMs(1.1, 0.5, 0.2, 0.15, 0.1, 0.05)));
|
||||
BlockFlags.addFlags("COMPOSTER", BlockFlags.SOLID_GROUND | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_MIN_HEIGHT8_1);
|
||||
BlockInit.setAs("LECTERN", Material.OAK_PLANKS);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_MIN_HEIGHT16_14);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_MIN_HEIGHT8_1);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_GROUND);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_MIN_HEIGHT8_1 | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockInit.setAs("BARREL", Material.OAK_PLANKS);
|
||||
BlockProperties.setBlockProps("SCAFFOLDING", instant);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_CLIMBABLE);
|
||||
BlockInit.setAs("STONECUTTER", Material.BRICK_SLAB);
|
||||
BlockFlags.addFlags("STONECUTTER", BlockProperties.F_MIN_HEIGHT16_9);
|
||||
BlockFlags.addFlags("STONECUTTER", BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockProperties.setBlockProps("BAMBOO", new BlockProperties.BlockProps(BlockProperties.noTool, 0.7f, BlockProperties.secToMs(1.25)));
|
||||
BlockProperties.setBlockProps("SCAFFOLDING", instant);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_CLIMBABLE);
|
||||
BlockProperties.setBlockProps("STONECUTTER", new BlockProperties.BlockProps(BlockProperties.woodPickaxe, 6.0f, BlockProperties.secToMs(17.0, 2.8, 1.8, 0.7, 0.8, 0.5)));
|
||||
BlockFlags.addFlags("STONECUTTER", BlockProperties.F_MIN_HEIGHT16_9 | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockProperties.setBlockProps("BAMBOO", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.7f, BlockProperties.secToMs(1.2, 0.5, 0.2, 0.15, 0.1, 0.05)));
|
||||
BlockProperties.setBlockProps("BAMBOO_SAPLING", new BlockProperties.BlockProps(BlockProperties.noTool, 0.7f, BlockProperties.secToMs(1.25)));
|
||||
BlockFlags.addFlags("BAMBOO", BlockProperties.F_IGN_PASSABLE | BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_THIN_FENCE);
|
||||
BlockFlags.addFlags("BAMBOO", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("BAMBOO_SAPLING", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockFlags.addFlags("WITHER_ROSE", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockProperties.setBlockProps("WITHER_ROSE", instant);
|
||||
@@ -143,6 +140,7 @@ public class BlocksMC1_14 implements BlockPropertiesSetup{
|
||||
BlockInit.setAs("CAMPFIRE", Material.OAK_PLANKS);
|
||||
BlockFlags.addFlags("CAMPFIRE", BlockProperties.F_MIN_HEIGHT16_7);
|
||||
BlockFlags.addFlags("CAMPFIRE", BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("BELL", BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockProperties.setBlockProps("BELL", new BlockProperties.BlockProps(BlockProperties.woodPickaxe, 7f, BlockProperties.secToMs(23.0, 3.8, 2.2, 1, 1.5, 0.8)));
|
||||
BlockProperties.setBlockProps("LANTERN", new BlockProperties.BlockProps(BlockProperties.woodPickaxe, 6.0f, BlockProperties.secToMs(17.0, 2.8, 1.8, 0.7, 0.8, 0.5)));
|
||||
BlockFlags.addFlags("LANTERN", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
|
||||
+3
@@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.BlockPropertiesSetup;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
@@ -40,6 +41,8 @@ public class BlocksMC1_6_1 implements BlockPropertiesSetup{
|
||||
// Hay Bale
|
||||
BlockInit.setPropsAs("HAY_BLOCK", Material.STONE_BUTTON);
|
||||
BlockFlags.setFlagsAs("HAY_BLOCK", Material.STONE); // TODO: Assumption (!).
|
||||
|
||||
if (BridgeMaterial.getBlock("wall_sign") != null) BlockInit.setAs("WALL_SIGN", BridgeMaterial.SIGN);
|
||||
|
||||
// (Carpet via generic setup.)
|
||||
|
||||
|
||||
+1
-2
@@ -48,12 +48,11 @@ public class BlocksMC1_8 implements BlockPropertiesSetup {
|
||||
Material.PUMPKIN,
|
||||
Material.JACK_O_LANTERN,
|
||||
// Same core breaking times, but behave different on efficiency + other tool (?):
|
||||
Material.WALL_SIGN,
|
||||
BridgeMaterial.SIGN,
|
||||
}) {
|
||||
BlockProperties.setBlockProps(mat, props);
|
||||
}
|
||||
|
||||
|
||||
// Ladder.
|
||||
props = new BlockProps(BlockProperties.woodAxe, 0.4f, BlockProperties.secToMs(0.6, 0.3, 0.15, 0.1, 0.075, 0.05));
|
||||
BlockProperties.setBlockProps(Material.LADDER, props);
|
||||
|
||||
+3
-2
@@ -29,7 +29,7 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* Multi client protocol support between 1.7.x - 1.13.x.
|
||||
* Multi client protocol support between 1.7.x - 1.14.x.
|
||||
*
|
||||
* @author asofold
|
||||
*
|
||||
@@ -39,7 +39,7 @@ public class MultiClientProtocolBlockShapePatch extends AbstractBlockPropertiesP
|
||||
|
||||
public MultiClientProtocolBlockShapePatch() {
|
||||
activation
|
||||
.neutralDescription("Block shape patch for multi client protocol support around 1.7.x - 1.13.x.")
|
||||
.neutralDescription("Block shape patch for multi client protocol support around 1.7.x - 1.14.x.")
|
||||
.advertise(true)
|
||||
.setConditionsAND()
|
||||
.notUnitTest()
|
||||
@@ -53,6 +53,7 @@ public class MultiClientProtocolBlockShapePatch extends AbstractBlockPropertiesP
|
||||
|
||||
final List<String> done = new LinkedList<String>();
|
||||
|
||||
//This freaks out with 1.8 using viaversion
|
||||
BlockFlags.addFlags(BridgeMaterial.LILY_PAD,
|
||||
BlockProperties.F_GROUND
|
||||
| BlockProperties.F_HEIGHT8_1
|
||||
|
||||
@@ -574,6 +574,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_VEHICLE_MOREPACKETS_ACTIONS, "cancel vl>10 log:morepackets:0:2:if cancel", 785);
|
||||
|
||||
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);
|
||||
|
||||
// Messages
|
||||
|
||||
@@ -907,8 +907,13 @@ public class PlayerDataManager implements IPlayerDataManager, ComponentWithName
|
||||
|
||||
@Override
|
||||
public PlayerData getPlayerData(final Player player, boolean create) {
|
||||
try {
|
||||
return getPlayerData(player.getUniqueId(), player.getName(),
|
||||
create, create ? worldDataManager.getWorldDataSafe(player) : null);
|
||||
} catch (Exception e) {
|
||||
// Fake player
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.utilities;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
@@ -51,5 +52,29 @@ public class PotionUtil {
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get amplifier for a potion effect.
|
||||
*
|
||||
* @param entity
|
||||
* the LivingEntity
|
||||
* @param type
|
||||
* the type
|
||||
* @return Double.NEGATIVE_INFINITY if not present, otherwise the maximal
|
||||
* amplifier.
|
||||
*/
|
||||
public static final double getPotionEffectAmplifier(final LivingEntity entity, final PotionEffectType type) {
|
||||
if (!entity.hasPotionEffect(type)) {
|
||||
return Double.NEGATIVE_INFINITY; // TODO: Might not win anything.
|
||||
}
|
||||
final Collection<PotionEffect> effects = entity.getActivePotionEffects();
|
||||
double max = Double.NEGATIVE_INFINITY;
|
||||
for (final PotionEffect effect : effects){
|
||||
if (effect.getType().equals(type)){
|
||||
max = Math.max(max, effect.getAmplifier());
|
||||
}
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -267,6 +267,26 @@ 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)) {
|
||||
|
||||
+6
-1
@@ -22,6 +22,7 @@ import fr.neatmonster.nocheatplus.compat.MCAccess;
|
||||
import fr.neatmonster.nocheatplus.components.registry.event.IHandle;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
@@ -32,6 +33,8 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
*/
|
||||
public class RichEntityLocation extends RichBoundsLocation {
|
||||
|
||||
private final boolean is1_14Above = BridgeMaterial.getBlock("lectern") != null;
|
||||
|
||||
/*
|
||||
* TODO: HumanEntity default with + height (1.11.2): elytra 0.6/0.6,
|
||||
* sleeping 0.2/0.2, sneaking 0.6/1.65, normal 0.6/1.8 - head height is 0.4
|
||||
@@ -369,7 +372,9 @@ public class RichEntityLocation extends RichBoundsLocation {
|
||||
isLiving = true;
|
||||
final LivingEntity living = (LivingEntity) entity;
|
||||
eyeHeight = living.getEyeHeight();
|
||||
fullHeight = Math.max(Math.max(fullHeight, eyeHeight), living.getEyeHeight(true));
|
||||
//Sneaking in Minecraft 1.14 and possibility later version will have lower height
|
||||
// 0.179999?
|
||||
fullHeight = is1_14Above ? eyeHeight + 0.179 : Math.max(Math.max(fullHeight, eyeHeight), living.getEyeHeight(true));
|
||||
}
|
||||
else {
|
||||
isLiving = false;
|
||||
|
||||
+27
-5
@@ -734,6 +734,9 @@ public class BlockProperties {
|
||||
/** Thick fence (default wooden fence). */
|
||||
public static final long F_THICK_FENCE = f_flag();
|
||||
|
||||
/** Thick fence (default cobblestone wall). */
|
||||
public static final long F_THICK_FENCE2 = f_flag();
|
||||
|
||||
/** Fence gate style with 0x04 being fully passable. */
|
||||
public static final long F_PASSABLE_X4 = f_flag();
|
||||
|
||||
@@ -983,26 +986,32 @@ public class BlockProperties {
|
||||
}
|
||||
|
||||
private static void setFlag(Material material, long addFlag) {
|
||||
try {
|
||||
if (!material.isBlock()) {
|
||||
// Let's not fail hard here.
|
||||
StaticLog.logWarning("Attempt to set flag for a non-block: " + material);
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
blockFlags.put(material, blockFlags.get(material) | addFlag);
|
||||
}
|
||||
|
||||
private static void maskFlag(Material material, long addFlag) {
|
||||
try {
|
||||
if (!material.isBlock()) {
|
||||
// Let's not fail hard here.
|
||||
StaticLog.logWarning("Attempt to mask flag for a non-block: " + material);
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
blockFlags.put(material, blockFlags.get(material) & addFlag);
|
||||
}
|
||||
|
||||
private static void setBlock(Material material, BlockProps props) {
|
||||
try {
|
||||
if (!material.isBlock()) {
|
||||
// Let's not fail hard here.
|
||||
StaticLog.logWarning("Attempt to set block breaking properties for a non-block: " + material);
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
blocks.put(material, props);
|
||||
}
|
||||
|
||||
@@ -1060,7 +1069,7 @@ public class BlockProperties {
|
||||
setFlag(mat, stepFlags);
|
||||
}
|
||||
for (final Material mat : MaterialUtil.NEWLIQ) {
|
||||
setFlag(mat, stepFlags | F_GROUND_HEIGHT | F_CLIMBABLE | F_CLIMBLIQ);
|
||||
setFlag(mat, F_XZ100 | F_CLIMBABLE | F_CLIMBLIQ);
|
||||
}
|
||||
|
||||
// Rails
|
||||
@@ -1513,9 +1522,9 @@ public class BlockProperties {
|
||||
// 95 Locked chest
|
||||
// blocks[95] = indestructibleType; // Locked chest (prevent crash with 1.7).
|
||||
if (BridgeMaterial.has("locked_chest")) {
|
||||
BlockFlags.setFlagsAs("locked_chest", Material.CHEST);
|
||||
BlockFlags.setFlagsAs("LOCKED_CHEST", Material.CHEST);
|
||||
// Breaks like chest later on.
|
||||
setBlockProps("locked_chest", BlockProperties.instantType);
|
||||
setBlockProps("LOCKED_CHEST", BlockProperties.chestType);
|
||||
}
|
||||
|
||||
// Terracotta (hard_clay).
|
||||
@@ -2561,10 +2570,12 @@ public class BlockProperties {
|
||||
* the flags
|
||||
*/
|
||||
public static final void setBlockFlags(final Material blockType, final long flags) {
|
||||
try {
|
||||
if (!blockType.isBlock()) {
|
||||
// Let's not fail hard here.
|
||||
StaticLog.logWarning("Attempt to set flags for a non-block: " + blockType);
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
blockFlags.put(blockType, flags);
|
||||
}
|
||||
|
||||
@@ -3120,6 +3131,14 @@ public class BlockProperties {
|
||||
// (Allow checking further entries.)
|
||||
return true;
|
||||
}
|
||||
else if ((flags & F_THICK_FENCE2) != 0) {
|
||||
if (!collidesFence(fx, fz, dX, dZ, dT, 0.26)) {
|
||||
return true;
|
||||
}
|
||||
if (!collidesFence(fx, fz, dX, dZ, dT, 0.13)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ((flags & F_THICK_FENCE) != 0) {
|
||||
if (!collidesFence(fx, fz, dX, dZ, dT, 0.125)) {
|
||||
return true;
|
||||
@@ -3157,7 +3176,10 @@ public class BlockProperties {
|
||||
else if ((flags & F_GROUND_HEIGHT) != 0
|
||||
&& getGroundMinHeight(access, bx, by, bz, node, flags) <= Math.min(fy, fy + dY * dT)) {
|
||||
return true;
|
||||
}
|
||||
} 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;
|
||||
// Nothing found.
|
||||
return false;
|
||||
}
|
||||
@@ -3332,7 +3354,7 @@ public class BlockProperties {
|
||||
return 0.5;
|
||||
}
|
||||
}
|
||||
else if ((flags & F_THICK_FENCE) != 0) {
|
||||
else if ((flags & F_THICK_FENCE) != 0 || (flags & F_THICK_FENCE2) != 0) {
|
||||
return Math.min(1.0, bounds[4]);
|
||||
}
|
||||
else if (id == Material.SOUL_SAND) {
|
||||
|
||||
@@ -88,7 +88,7 @@ public class MapUtil {
|
||||
for (int cz = minZ; cz <= maxZ; cz ++) {
|
||||
if (!world.isChunkLoaded(cx, cz)) {
|
||||
try {
|
||||
world.loadChunk(cx, cz);
|
||||
world.getChunkAt(cx, cz);
|
||||
loaded ++;
|
||||
} catch (Exception ex) {
|
||||
// (Can't seem to catch more precisely: TileEntity with CB 1.7.10)
|
||||
|
||||
@@ -365,7 +365,7 @@ public class MaterialUtil {
|
||||
public static final Set<Material> WATER = Collections.unmodifiableSet(
|
||||
BridgeMaterial.getAllBlocks("water", "stationary_water"));
|
||||
public static final Set<Material> NEWLIQ = Collections.unmodifiableSet(
|
||||
BridgeMaterial.getAllBlocks("TALL_SEAGRASS", "KELP_PLANT", "SEAGRASS"));
|
||||
BridgeMaterial.getAllBlocks("TALL_SEAGRASS", "KELP_PLANT", "SEAGRASS", "KELP"));
|
||||
|
||||
/** Wood types (1.13 rather). */
|
||||
public static final Set<Material> WOOD_BLOCKS = Collections.unmodifiableSet(addBlocks(
|
||||
|
||||
+6
-6
@@ -10,8 +10,8 @@
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>Mainly contains the plugin class and the factories.
|
||||
|
||||
<description>Mainly contains the plugin class and the factories.
|
||||
|
||||
For the plugin/artifact version see the NoCheatPlus module.</description>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
@@ -28,9 +28,9 @@ For the plugin/artifact version see the NoCheatPlus module.</description>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -100,4 +100,4 @@ For the plugin/artifact version see the NoCheatPlus module.</description>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -1085,7 +1085,6 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
||||
StaticLog.setStreamID(Streams.STATUS);
|
||||
// Tell the server administrator that we finished loading NoCheatPlus now.
|
||||
logManager.info(Streams.INIT, "Version " + getDescription().getVersion() + " is enabled.");
|
||||
logManager.warning(Streams.INIT, "You are running a modified version of NCP. This version should only be used on 1.13 servers. This is only intended as a band-aid fix while NCP can be properly updated to 1.13. You may be sacrificing cheat protection for compatibility");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-2
@@ -33,9 +33,10 @@ import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
*/
|
||||
public class MCAccessFactory {
|
||||
|
||||
//Message below is sent when CBDedicated and CBReflect failed to run and NCP switches to bukkit's api as it can't tell the server version.
|
||||
private final String[] updateLocs = new String[] {
|
||||
" Check for updates and support at BukkitDev: https://dev.bukkit.org/projects/nocheatplus/",
|
||||
" Development builds (unsupported by the Bukkit Staff, use at your own risk): https://ci.md-5.net/job/NoCheatPlus/changes",
|
||||
// " Check for updates and support at BukkitDev: https://dev.bukkit.org/projects/nocheatplus/",
|
||||
// " Development builds (unsupported by the Bukkit Staff, use at your own risk): https://ci.md-5.net/job/NoCheatPlus/changes",
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,16 +46,16 @@ public class TestConfig {
|
||||
testReadMaterial(lilys.replaceAll("_", "-"), lily);
|
||||
testReadMaterial(lilys.replaceAll("e", "E"), lily);
|
||||
|
||||
testReadMaterial("flint and steel", Material.FLINT_AND_STEEL);
|
||||
testReadMaterial("259", Material.FLINT_AND_STEEL);
|
||||
//testReadMaterial("flint and steel", Material.FLINT_AND_STEEL);
|
||||
//testReadMaterial("259", Material.FLINT_AND_STEEL);
|
||||
|
||||
// Generic test.
|
||||
for (final Material mat : Material.values()) {
|
||||
if (mat.name().equalsIgnoreCase("LOCKED_CHEST")) {
|
||||
continue;
|
||||
}
|
||||
testReadMaterial(mat.name(), mat);
|
||||
testReadMaterial(Integer.toString(mat.getId()), mat);
|
||||
//testReadMaterial(mat.name(), mat);
|
||||
//testReadMaterial(Integer.toString(mat.getId()), mat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,10 +103,10 @@ public class TestConfig {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testActionLists() {
|
||||
ConfigFile config = new DefaultConfig();
|
||||
config.getOptimizedActionList(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, null);
|
||||
}
|
||||
// @Test
|
||||
// public void testActionLists() {
|
||||
// ConfigFile config = new DefaultConfig();
|
||||
// config.getOptimizedActionList(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, null);
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -44,10 +44,14 @@
|
||||
</repository>
|
||||
<!-- <repository> <id>md_5-releases</id> <url>http://repo.md-5.net/content/repositories/releases/</url>
|
||||
</repository> <repository> <id>md_5-snapshots</id> <url>http://repo.md-5.net/content/repositories/snapshots/</url>
|
||||
</repository> -->
|
||||
</repository>
|
||||
<repository>
|
||||
<id>bukkit</id>
|
||||
<url>http://repo.bukkit.org/content/groups/public/</url>
|
||||
</repository> -->
|
||||
<repository>
|
||||
<id>nms-repo</id>
|
||||
<url>https://repo.codemc.org/repository/nms/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
Reference in new issue
Block a user