Skip to content

Commit 9e4b1aa

Browse files
committed
Updates to conduit utils.
1 parent d3d4d23 commit 9e4b1aa

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package sunsetsatellite.catalyst.core.util;
22

3-
public interface IConduit {
3+
public interface IConduitBlock {
44
ConduitCapability getConduitCapability();
55
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package sunsetsatellite.catalyst.core.util;
2+
3+
public interface IConduitTile {
4+
ConduitCapability getConduitCapability();
5+
}

src/main/java/sunsetsatellite/catalyst/core/util/Vec3i.java

+19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package sunsetsatellite.catalyst.core.util;
22

33
import com.mojang.nbt.CompoundTag;
4+
import net.minecraft.core.block.entity.TileEntity;
45
import net.minecraft.core.util.helper.MathHelper;
6+
import net.minecraft.core.world.WorldSource;
57

68
public class Vec3i {
79
public int x;
@@ -43,6 +45,19 @@ public double distanceTo(Vec3f vec3f) {
4345
return MathHelper.sqrt_double(d * d + d1 * d1 + d2 * d2);
4446
}
4547

48+
public double distanceTo(Vec3i vec3i) {
49+
double d = vec3i.x - this.x;
50+
double d1 = vec3i.y - this.y;
51+
double d2 = vec3i.z - this.z;
52+
return MathHelper.sqrt_double(d * d + d1 * d1 + d2 * d2);
53+
}
54+
55+
public void set(int x, int y, int z){
56+
this.x = x;
57+
this.y = y;
58+
this.z = z;
59+
}
60+
4661
public Vec3i add(int value){
4762
this.x += value;
4863
this.y += value;
@@ -178,4 +193,8 @@ public int hashCode() {
178193
result = 31 * result + z;
179194
return result;
180195
}
196+
197+
public TileEntity getTileEntity(WorldSource worldSource){
198+
return worldSource.getBlockTileEntity(this.x, this.y, this.z);
199+
}
181200
}

0 commit comments

Comments
 (0)