Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ record PrefixMethodPair(MethodNode dasmAddedMethod, MethodNode mixinAddedMethod)
List<PrefixMethodPair> methodPairs = new ArrayList<>();
for (MethodNode methodNode : targetClass.methods) {
if (methodNode.name.contains("cc_dasm$")) {
var methodNameWithoutPrefix = methodNode.name.substring(methodNode.name.indexOf("$") + 1);
var methodNameWithoutPrefix = methodNode.name.substring(methodNode.name.indexOf("$") + 1).replace("__init__", "<init>")
.replace("__clinit__", "<clinit>");

var mixinAddedMethod = targetClass.methods.stream()
.filter(m -> m.name.equals(methodNameWithoutPrefix) && m.desc.equals(methodNode.desc)).findFirst();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,14 @@ public static class Builder {
@AddFieldToSets(containers = ChunkToCubeSet.ChunkStep$Builder_to_CubeStep$Builder_redirects.class, field = @FieldSig(type = @Ref(ChunkStatusTask.class), name = "task"))
private CubeStatusTask task = (worldGenContext, step, cache, cube) -> CompletableFuture.completedFuture(cube);

// TODO these should be dasm-copied but for some reason it didn't work when I tried
@TransformFromMethod(owner = @Ref(ChunkStep.Builder.class), value = @MethodSig("<init>(Lnet/minecraft/world/level/chunk/status/ChunkStatus;)V"))
protected Builder(ChunkStatus status) {
if (status.getParent() != status) {
throw new IllegalArgumentException("Not starting with the first status: " + status);
} else {
this.status = status;
this.parent = null;
this.directDependenciesByRadius = new ChunkStatus[0];
}
throw new DasmFailedToApply();
}

@TransformFromMethod(owner = @Ref(ChunkStep.Builder.class), value = @MethodSig("<init>(Lnet/minecraft/world/level/chunk/status/ChunkStatus;Lnet/minecraft/world/level/chunk/status/ChunkStep;)V"))
protected Builder(ChunkStatus status, CubeStep parent) {
if (parent.targetStatus.getIndex() != status.getIndex() - 1) {
throw new IllegalArgumentException("Out of order status: " + status);
} else {
this.status = status;
this.parent = parent;
this.directDependenciesByRadius = new ChunkStatus[] { parent.targetStatus };
}
throw new DasmFailedToApply();
}

// TODO could be mixin + DASM
Expand Down