Commits
md_5 authored 1d2509b99fb
9 9 | * hash maps. Be aware that BlockVectors are mutable, but it is important |
10 10 | * that BlockVectors are never changed once put into a hash set or hash map. |
11 11 | */ |
12 12 | "BlockVector") | (
13 13 | public class BlockVector extends Vector { |
14 14 | |
15 15 | /** |
16 16 | * Construct the vector with all components as 0. |
17 17 | */ |
18 18 | public BlockVector() { |
19 - | super(); |
19 + | this.x = 0; |
20 + | this.y = 0; |
21 + | this.z = 0; |
20 22 | } |
21 23 | |
22 24 | /** |
23 25 | * Construct the vector with another vector. |
24 26 | * |
25 27 | * @param vec The other vector. |
26 28 | */ |
27 29 | public BlockVector(Vector vec) { |
28 - | this(vec.getX(), vec.getY(), vec.getZ()); |
30 + | this.x = vec.getX(); |
31 + | this.y = vec.getY(); |
32 + | this.z = vec.getZ(); |
29 33 | } |
30 34 | |
31 35 | /** |
32 36 | * Construct the vector with provided integer components. |
33 37 | * |
34 38 | * @param x X component |
35 39 | * @param y Y component |
36 40 | * @param z Z component |
37 41 | */ |
38 42 | public BlockVector(int x, int y, int z) { |
39 - | super(x, y, z); |
43 + | this.x = x; |
44 + | this.y = y; |
45 + | this.z = z; |
40 46 | } |
41 47 | |
42 48 | /** |
43 49 | * Construct the vector with provided double components. |
44 50 | * |
45 51 | * @param x X component |
46 52 | * @param y Y component |
47 53 | * @param z Z component |
48 54 | */ |
49 55 | public BlockVector(double x, double y, double z) { |
50 - | super(x, y, z); |
56 + | this.x = x; |
57 + | this.y = y; |
58 + | this.z = z; |
51 59 | } |
52 60 | |
53 61 | /** |
54 62 | * Construct the vector with provided float components. |
55 63 | * |
56 64 | * @param x X component |
57 65 | * @param y Y component |
58 66 | * @param z Z component |
59 67 | */ |
60 68 | public BlockVector(float x, float y, float z) { |
61 - | super(x, y, z); |
69 + | this.x = x; |
70 + | this.y = y; |
71 + | this.z = z; |
62 72 | } |
63 73 | |
64 74 | /** |
65 75 | * Checks if another object is equivalent. |
66 76 | * |
67 77 | * @param obj The other object |
68 78 | * @return whether the other object is equivalent |
69 79 | */ |
70 80 | |
71 81 | public boolean equals(Object obj) { |