Fixed several bugs

This commit is contained in:
Auxilor
2020-11-21 11:26:41 +00:00
parent 4e08a5c0af
commit 84f15b4e96
6 changed files with 6 additions and 15 deletions

View File

@@ -25,7 +25,6 @@ public final class Dullness extends EcoEnchant {
return;
}
if(!EnchantmentUtils.passedChance(this, level))
return;

View File

@@ -32,7 +32,7 @@ public final class Frozen extends EcoEnchant {
Player player = (Player) event.getEntity();
LivingEntity victim = (LivingEntity) event.getDamager();
final int points = EnchantChecks.getArmorPoints(player, this, 1);
final int points = EnchantChecks.getArmorPoints(player, this, 0);
if (points == 0)
return;

View File

@@ -39,6 +39,6 @@ public final class Launch extends EcoEnchant {
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
double boost = 1 + (multiplier * level);
Bukkit.getScheduler().runTaskLater(EcoEnchantsPlugin.getInstance(), () -> player.setVelocity(player.getVelocity().multiply(boost)), 1);
Bukkit.getScheduler().runTask(EcoEnchantsPlugin.getInstance(), () -> player.setVelocity(player.getVelocity().multiply(boost)));
}
}

View File

@@ -42,7 +42,7 @@ public final class AntigriefGriefPrevention implements AntigriefWrapper {
if(victim instanceof Player) {
return claim == null;
} else {
if (claim != null) {
if (claim != null && claim.ownerID != null) {
return claim.ownerID.equals(player.getUniqueId());
}
return true;

View File

@@ -4,24 +4,16 @@ import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.integrations.anvilgui.AnvilGUIIntegration;
public class AnvilGUIImpl implements AnvilGUIIntegration {
private static Class<?> ANVIL_GUI_CLASS = null;
private static final String ANVIL_GUI_CLASS = "net.wesjd.anvilgui.version.Wrapper" + EcoEnchantsPlugin.NMS_VERSION.substring(1) + "$AnvilContainer";
@Override
public boolean isInstance(Object object) {
assert ANVIL_GUI_CLASS != null;
return object.getClass().equals(ANVIL_GUI_CLASS);
return object.getClass().toString().equals(ANVIL_GUI_CLASS);
}
@Override
public String getPluginName() {
return "AnvilGUI";
}
static {
try {
ANVIL_GUI_CLASS = Class.forName("net.wesjd.anvilgui.version.Wrapper" + EcoEnchantsPlugin.NMS_VERSION.substring(1) + "$AnvilContainer");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}

View File

@@ -21,4 +21,4 @@ general-config:
config:
chance-per-level: 2.5
ticks-per-level: 5
ticks-per-level: 10