Replace klass with cla$$

This commit is contained in:
Babbaj 2019-08-28 20:37:05 -04:00
parent 33080a4e1c
commit a7add6bc13
No known key found for this signature in database
GPG Key ID: 48FD0BEFD63C8E3F
3 changed files with 11 additions and 11 deletions

View File

@ -985,10 +985,10 @@ public final class Settings {
} }
@SuppressWarnings("unchecked") @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<>(); List<Setting<T>> result = new ArrayList<>();
for (Setting<?> setting : allSettings) { for (Setting<?> setting : allSettings) {
if (setting.getValueClass().equals(klass)) { if (setting.getValueClass().equals(cla$$)) {
result.add((Setting<T>) setting); result.add((Setting<T>) setting);
} }
} }

View File

@ -222,22 +222,22 @@ public class SettingsUtil {
} }
}; };
private final Class<?> klass; private final Class<?> cla$$;
private final Function<String, Object> parser; private final Function<String, Object> parser;
private final Function<Object, String> toString; private final Function<Object, String> toString;
Parser() { Parser() {
this.klass = null; this.cla$$ = null;
this.parser = null; this.parser = null;
this.toString = null; this.toString = null;
} }
<T> Parser(Class<T> klass, Function<String, T> parser) { <T> Parser(Class<T> cla$$, Function<String, T> parser) {
this(klass, parser, Object::toString); this(cla$$, parser, Object::toString);
} }
<T> Parser(Class<T> klass, Function<String, T> parser, Function<T, String> toString) { <T> Parser(Class<T> cla$$, Function<String, T> parser, Function<T, String> toString) {
this.klass = klass; this.cla$$ = cla$$;
this.parser = parser::apply; this.parser = parser::apply;
this.toString = x -> toString.apply((T) x); this.toString = x -> toString.apply((T) x);
} }
@ -256,7 +256,7 @@ public class SettingsUtil {
@Override @Override
public boolean accepts(Type type) { 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) { public static Parser getParser(Type type) {

View File

@ -102,7 +102,7 @@ public final class InventoryBehavior extends Behavior {
return -1; 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; NonNullList<ItemStack> invy = ctx.player().inventory.mainInventory;
int bestInd = -1; int bestInd = -1;
double bestSpeed = -1; double bestSpeed = -1;
@ -111,7 +111,7 @@ public final class InventoryBehavior extends Behavior {
if (stack.isEmpty()) { if (stack.isEmpty()) {
continue; continue;
} }
if (klass.isInstance(stack.getItem())) { if (cla$$.isInstance(stack.getItem())) {
double speed = ToolSet.calculateSpeedVsBlock(stack, against.getDefaultState()); // takes into account enchants double speed = ToolSet.calculateSpeedVsBlock(stack, against.getDefaultState()); // takes into account enchants
if (speed > bestSpeed) { if (speed > bestSpeed) {
bestSpeed = speed; bestSpeed = speed;