commit
5ce644718e
@ -985,10 +985,10 @@ public final class Settings {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> List<Setting<T>> getAllValuesByType(Class<T> klass) {
|
||||
public <T> List<Setting<T>> getAllValuesByType(Class<T> cla$$) {
|
||||
List<Setting<T>> result = new ArrayList<>();
|
||||
for (Setting<?> setting : allSettings) {
|
||||
if (setting.getValueClass().equals(klass)) {
|
||||
if (setting.getValueClass().equals(cla$$)) {
|
||||
result.add((Setting<T>) setting);
|
||||
}
|
||||
}
|
||||
|
@ -222,22 +222,22 @@ public class SettingsUtil {
|
||||
}
|
||||
};
|
||||
|
||||
private final Class<?> klass;
|
||||
private final Class<?> cla$$;
|
||||
private final Function<String, Object> parser;
|
||||
private final Function<Object, String> toString;
|
||||
|
||||
Parser() {
|
||||
this.klass = null;
|
||||
this.cla$$ = null;
|
||||
this.parser = null;
|
||||
this.toString = null;
|
||||
}
|
||||
|
||||
<T> Parser(Class<T> klass, Function<String, T> parser) {
|
||||
this(klass, parser, Object::toString);
|
||||
<T> Parser(Class<T> cla$$, Function<String, T> parser) {
|
||||
this(cla$$, parser, Object::toString);
|
||||
}
|
||||
|
||||
<T> Parser(Class<T> klass, Function<String, T> parser, Function<T, String> toString) {
|
||||
this.klass = klass;
|
||||
<T> Parser(Class<T> cla$$, Function<String, T> parser, Function<T, String> toString) {
|
||||
this.cla$$ = cla$$;
|
||||
this.parser = parser::apply;
|
||||
this.toString = x -> toString.apply((T) x);
|
||||
}
|
||||
@ -256,7 +256,7 @@ public class SettingsUtil {
|
||||
|
||||
@Override
|
||||
public boolean accepts(Type type) {
|
||||
return type instanceof Class && this.klass.isAssignableFrom((Class) type);
|
||||
return type instanceof Class && this.cla$$.isAssignableFrom((Class) type);
|
||||
}
|
||||
|
||||
public static Parser getParser(Type type) {
|
||||
|
@ -102,7 +102,7 @@ public final class InventoryBehavior extends Behavior {
|
||||
return -1;
|
||||
}
|
||||
|
||||
private int bestToolAgainst(Block against, Class<? extends ItemTool> klass) {
|
||||
private int bestToolAgainst(Block against, Class<? extends ItemTool> cla$$) {
|
||||
NonNullList<ItemStack> invy = ctx.player().inventory.mainInventory;
|
||||
int bestInd = -1;
|
||||
double bestSpeed = -1;
|
||||
@ -111,7 +111,7 @@ public final class InventoryBehavior extends Behavior {
|
||||
if (stack.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (klass.isInstance(stack.getItem())) {
|
||||
if (cla$$.isInstance(stack.getItem())) {
|
||||
double speed = ToolSet.calculateSpeedVsBlock(stack, against.getDefaultState()); // takes into account enchants
|
||||
if (speed > bestSpeed) {
|
||||
bestSpeed = speed;
|
||||
|
Loading…
Reference in New Issue
Block a user