From bbb40fbfbfa9dff0e7228a4a5fa947f280abb051 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 24 Sep 2012 19:44:20 -0400 Subject: [PATCH] Fixed vclip to ignore non-solid blocks --- pom.xml | 2 +- .../net/h31ix/anticheat/manage/Backend.java | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 6a8b559..efb4b8b 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ org.bukkit - bukkit + craftbukkit 1.3.2-R0.1 jar compile diff --git a/src/main/java/net/h31ix/anticheat/manage/Backend.java b/src/main/java/net/h31ix/anticheat/manage/Backend.java index d514654..84ffa09 100644 --- a/src/main/java/net/h31ix/anticheat/manage/Backend.java +++ b/src/main/java/net/h31ix/anticheat/manage/Backend.java @@ -249,7 +249,11 @@ public class Backend public void garbageClean(Player player) { String pN = player.getName(); - micromanage.getUserManager().remove(micromanage.getUserManager().getUser(pN)); + User user = micromanage.getUserManager().getUser(pN); + if(user != null) + { + micromanage.getUserManager().remove(user); + } droppedItem.remove(pN); movingExempt.remove(pN); brokenBlock.remove(pN); @@ -534,24 +538,29 @@ public class Backend boolean bs = false; if (player.isInsideVehicle()) + { return 0; - + } if (from == to || from < to) + { return 0; - + } if (Math.round(distance.getYDifference()) < 2) + { return 0; + } for (int i = 0; i < (Math.round(distance.getYDifference())) + 1; i++) { Location l = new Location(player.getWorld(), player.getLocation().getX(), to + i, player.getLocation().getZ()); - if (l.getBlock().getTypeId() != 0 && !l.getBlock().isLiquid()) + if (l.getBlock().getTypeId() != 0 && net.minecraft.server.Block.byId[l.getBlock().getTypeId()].material.isSolid() && !l.getBlock().isLiquid()) { bs = true; } - if (bs) + { return (int) from + 3; + } } return 0;