Use newer Java features in places where it makes sense and more (#1009)

This commit is contained in:
altrisi authored and GitHub committed 2021-08-03 07:32:40 -03:00
1 parent 28cb136c6b
commit 7fb5e47da5
34 files changed
+338 -399

No files matched your search

@@ -412,14 +412,14 @@ public class EntityValue extends Value
throw new InternalExpressionException("Cannot fetch '"+what+"' with these arguments");
}
}
private static final Map<String, EquipmentSlot> inventorySlots = new HashMap<String, EquipmentSlot>(){{
put("mainhand", EquipmentSlot.MAINHAND);
put("offhand", EquipmentSlot.OFFHAND);
put("head", EquipmentSlot.HEAD);
put("chest", EquipmentSlot.CHEST);
put("legs", EquipmentSlot.LEGS);
put("feet", EquipmentSlot.FEET);
}};
private static final Map<String, EquipmentSlot> inventorySlots = Map.of(
"mainhand", EquipmentSlot.MAINHAND,
"offhand", EquipmentSlot.OFFHAND,
"head", EquipmentSlot.HEAD,
"chest", EquipmentSlot.CHEST,
"legs", EquipmentSlot.LEGS,
"feet", EquipmentSlot.FEET
);
private static final Map<String, BiFunction<Entity, Value, Value>> featureAccessors = new HashMap<String, BiFunction<Entity, Value, Value>>() {{
//put("test", (e, a) -> a == null ? Value.NULL : new StringValue(a.getString()));