CubeListBuilder .java

net.minecraft.client.model.geom.builders.CubeListBuilder (class): members: ALL_VISIBLE, getCubes, texOffs, addBox, xTexScale, xTexOffs, yTexOffs, cubes.

net.minecraft.client.model.geom.buildersclass115 linesclient4.1 KB

API Surface (14)

CubeListBuilder texOffs(final int xTexOffs, final int yTexOffs)
CubeListBuilder mirror()
CubeListBuilder mirror(final boolean mirror)
CubeListBuilder addBox(final String id, final float x0, final float y0, final float z0, final int w, final int h, final int d, final CubeDeformation g, final int xTexOffs, final int yTexOffs)
CubeListBuilder addBox(final String id, final float x0, final float y0, final float z0, final int w, final int h, final int d, final int xTexOffs, final int yTexOffs)
CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d)
CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d, final Set<Direction> visibleSides)
CubeListBuilder addBox(final String id, final float x0, final float y0, final float z0, final float w, final float h, final float d)
CubeListBuilder addBox(final String id, final float x0, final float y0, final float z0, final float w, final float h, final float d, final CubeDeformation g)
CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d, final boolean mirror)
CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d, final CubeDeformation g, final float xTexScale, final float yTexScale)
CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d, final CubeDeformation g)
List<CubeDefinition> getCubes()
CubeListBuilder create()

Fields & Constants (14)

ALL_VISIBLE
cubes
xTexOffs
yTexOffs
mirror
id
x0
y0
z0
w
h
d
g
xTexScale

Code Graph: Dependencies (3)

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

Full Source

CubeListBuilder.java115 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.model.geom.builders;
2
3
import com.google.common.collect.ImmutableList;
4
import com.google.common.collect.Lists;
5
import java.util.EnumSet;
6
import java.util.List;
7
import java.util.Set;
8
import net.fabricmc.api.EnvType;
9
import net.fabricmc.api.Environment;
10
import net.minecraft.core.Direction;
11
12
@Environment(EnvType.CLIENT)
13
public class CubeListBuilder {
14
	private static final Set<Direction> ALL_VISIBLE = EnumSet.allOf(Direction.class);
15
	private final List<CubeDefinition> cubes = Lists.newArrayList();
16
	private int xTexOffs;
17
	private int yTexOffs;
18
	private boolean mirror;
19
20
	public CubeListBuilder texOffs(final int xTexOffs, final int yTexOffs) {
21
		this.xTexOffs = xTexOffs;
22
		this.yTexOffs = yTexOffs;
23
		return this;
24
	}
25
26
	public CubeListBuilder mirror() {
27
		return this.mirror(true);
28
	}
29
30
	public CubeListBuilder mirror(final boolean mirror) {
31
		this.mirror = mirror;
32
		return this;
33
	}
34
35
	public CubeListBuilder addBox(
36
		final String id,
37
		final float x0,
38
		final float y0,
39
		final float z0,
40
		final int w,
41
		final int h,
42
		final int d,
43
		final CubeDeformation g,
44
		final int xTexOffs,
45
		final int yTexOffs
46
	) {
47
		this.texOffs(xTexOffs, yTexOffs);
48
		this.cubes.add(new CubeDefinition(id, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, g, this.mirror, 1.0F, 1.0F, ALL_VISIBLE));
49
		return this;
50
	}
51
52
	public CubeListBuilder addBox(
53
		final String id, final float x0, final float y0, final float z0, final int w, final int h, final int d, final int xTexOffs, final int yTexOffs
54
	) {
55
		this.texOffs(xTexOffs, yTexOffs);
56
		this.cubes.add(new CubeDefinition(id, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, CubeDeformation.NONE, this.mirror, 1.0F, 1.0F, ALL_VISIBLE));
57
		return this;
58
	}
59
60
	public CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d) {
61
		this.cubes.add(new CubeDefinition(null, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, CubeDeformation.NONE, this.mirror, 1.0F, 1.0F, ALL_VISIBLE));
62
		return this;
63
	}
64
65
	public CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d, final Set<Direction> visibleSides) {
66
		this.cubes.add(new CubeDefinition(null, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, CubeDeformation.NONE, this.mirror, 1.0F, 1.0F, visibleSides));
67
		return this;
68
	}
69
70
	public CubeListBuilder addBox(final String id, final float x0, final float y0, final float z0, final float w, final float h, final float d) {
71
		this.cubes.add(new CubeDefinition(id, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, CubeDeformation.NONE, this.mirror, 1.0F, 1.0F, ALL_VISIBLE));
72
		return this;
73
	}
74
75
	public CubeListBuilder addBox(
76
		final String id, final float x0, final float y0, final float z0, final float w, final float h, final float d, final CubeDeformation g
77
	) {
78
		this.cubes.add(new CubeDefinition(id, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, g, this.mirror, 1.0F, 1.0F, ALL_VISIBLE));
79
		return this;
80
	}
81
82
	public CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d, final boolean mirror) {
83
		this.cubes.add(new CubeDefinition(null, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, CubeDeformation.NONE, mirror, 1.0F, 1.0F, ALL_VISIBLE));
84
		return this;
85
	}
86
87
	public CubeListBuilder addBox(
88
		final float x0,
89
		final float y0,
90
		final float z0,
91
		final float w,
92
		final float h,
93
		final float d,
94
		final CubeDeformation g,
95
		final float xTexScale,
96
		final float yTexScale
97
	) {
98
		this.cubes.add(new CubeDefinition(null, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, g, this.mirror, xTexScale, yTexScale, ALL_VISIBLE));
99
		return this;
100
	}
101
102
	public CubeListBuilder addBox(final float x0, final float y0, final float z0, final float w, final float h, final float d, final CubeDeformation g) {
103
		this.cubes.add(new CubeDefinition(null, this.xTexOffs, this.yTexOffs, x0, y0, z0, w, h, d, g, this.mirror, 1.0F, 1.0F, ALL_VISIBLE));
104
		return this;
105
	}
106
107
	public List<CubeDefinition> getCubes() {
108
		return ImmutableList.copyOf(this.cubes);
109
	}
110
111
	public static CubeListBuilder create() {
112
		return new CubeListBuilder();
113
	}
114
}
115

Decompiled Minecraft 26.3 source of CubeListBuilder (net/minecraft/client/model/geom/builders/CubeListBuilder.java) with Mojang official mappings, stored verbatim on the site.