Fix binding order

This commit is contained in:
Jesse Boyd 2019-04-01 23:55:15 +11:00
parent 64a134a9ee
commit c820406e8c
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 8 additions and 3 deletions

View File

@ -357,7 +357,7 @@ public class ForwardExtentCopy implements Operation {
.stream()
.filter(entity -> entity.getState() != null &&
!entity.getState().getType().getId().equals("minecraft:player") &&
region.contains(entity.getLocation().toVector()))
region.contains(entity.getLocation().toBlockPoint()))
.collect(Collectors.toList());
} else {
entities = new ArrayList<>();

View File

@ -115,21 +115,26 @@ public class BindingMap implements Binding {
*/
private BoundMethod match(ParameterData pd) {
Type type = pd.getType();
BoundMethod result = null;
while (type != null) {
List<BoundMethod> methods = bindings.get(type);
if (methods != null) {
for (BoundMethod binding : methods) {
if (binding.classifier != null) {
if (pd.getClassifier() != null && pd.getClassifier().annotationType().equals(binding.classifier)) {
if (binding.type == null || binding.type.equals(type)) {
if (binding.type == null) {
result = binding;
} else if (binding.type.equals(type)) {
return binding;
}
}
} else if (binding.type.equals(type)) {
return binding;
if (result == null) result = binding;
}
}
}
if (result != null) return result;
type = (type instanceof Class) ? ((Class) type).getSuperclass() : null;
}
throw new RuntimeException("Unknown type " + pd.getType());