1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Added a debug line to finally fix this unit test

This commit is contained in:
TheBusyBiscuit 2020-10-04 11:51:03 +02:00
parent 2ff105dabe
commit ceadd2147f
2 changed files with 18 additions and 6 deletions

View File

@ -133,8 +133,15 @@ public class ItemSetting<T> {
Object configuredValue = SlimefunPlugin.getItemCfg().getValue(item.getID() + '.' + getKey());
if (defaultValue.getClass().isInstance(configuredValue)) {
if (validateInput((T) configuredValue)) {
this.value = (T) configuredValue;
}
else {
Slimefun.getLogger().log(Level.WARNING, "Slimefun has found an invalid config setting in your Items.yml!");
Slimefun.getLogger().log(Level.WARNING, " at \"{0}.{1}\"", new Object[] { item.getID(), getKey() });
Slimefun.getLogger().log(Level.WARNING, "{0} is not a valid input!", configuredValue);
}
}
else {
this.value = defaultValue;
String found = configuredValue == null ? "null" : configuredValue.getClass().getSimpleName();

View File

@ -122,7 +122,14 @@ public class ClimbingPick extends SimpleSlimefunItem<ItemUseHandler> implements
public double getClimbingSpeed(@Nonnull Material type) {
Validate.notNull(type, "The surface cannot be null");
ClimbableSurface surface = surfaces.get(type);
return surface != null ? surface.getValue() : 0;
if (surface != null) {
System.out.println(surface.getValue());
return surface.getValue();
}
else {
return 0;
}
}
/**
@ -168,11 +175,9 @@ public class ClimbingPick extends SimpleSlimefunItem<ItemUseHandler> implements
}
// Top and bottom faces won't be allowed
if (e.getClickedFace() == BlockFace.DOWN || e.getClickedFace() == BlockFace.UP) {
return;
}
if (e.getClickedFace() != BlockFace.DOWN && e.getClickedFace() != BlockFace.UP) {
climb(p, e.getHand(), e.getItem(), block);
}
};
}