Node .java

net.minecraft.util.filefix.virtualfilesystem.Node (class, 30 lines): permits F, D. members: setParent, setPath, path, parent, name. imports: Nullable.

net.minecraft.util.filefix.virtualfilesystemclass30 linescommon721 B

API Surface (3)

void setParent(final DirectoryNode parent)
void setPath(final CopyOnWriteFSPath path)
CopyOnWriteFSPath path()

Fields & Constants (2)

parent
path

Code Graph: Dependencies (2)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

Node.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.filefix.virtualfilesystem;
2
3
import org.jspecify.annotations.Nullable;
4
5
abstract sealed class Node permits FileNode, DirectoryNode {
6
	protected @Nullable DirectoryNode parent;
7
	protected CopyOnWriteFSPath path;
8
9
	protected Node(final CopyOnWriteFSPath cowPath) {
10
		this.setPath(cowPath);
11
	}
12
13
	public @Nullable String name() {
14
		CopyOnWriteFSPath fileName = this.path.getFileName();
15
		return fileName == null ? null : fileName.toString();
16
	}
17
18
	protected void setParent(final DirectoryNode parent) {
19
		this.parent = parent;
20
	}
21
22
	protected void setPath(final CopyOnWriteFSPath path) {
23
		this.path = path.normalize().toAbsolutePath();
24
	}
25
26
	public CopyOnWriteFSPath path() {
27
		return this.path;
28
	}
29
}
30

Decompiled Minecraft 26.3 source of Node (net/minecraft/util/filefix/virtualfilesystem/Node.java) with Mojang official mappings, stored verbatim on the site.