Skip to content

Commit 1c27f10

Browse files
committed
Small improvements.
1 parent 0a401ed commit 1c27f10

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class BlockInstance {
1414
public Vec3i pos;
1515
public int meta = 0;
1616
public TileEntity tile;
17+
public Vec3i offset;
1718

1819
public BlockInstance(@NotNull Block block, @NotNull Vec3i pos, TileEntity tile){
1920
this.block = block;

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

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

3+
import net.minecraft.core.block.Block;
34
import net.minecraft.core.block.entity.TileEntity;
45
import net.minecraft.core.util.phys.Vec3d;
56
import net.minecraft.core.world.WorldSource;
@@ -28,6 +29,16 @@ public TileEntity getTileEntity(WorldSource world, TileEntity tile){
2829
return world.getBlockTileEntity(pos.x,pos.y,pos.z);
2930
}
3031

32+
public Block getBlock(WorldSource world, TileEntity tile){
33+
Vec3i pos = new Vec3i(tile.x + vec.x, tile.y + vec.y, tile.z + vec.z);
34+
return world.getBlock(pos.x,pos.y,pos.z);
35+
}
36+
37+
public Block getBlock(WorldSource world, Vec3i baseVec){
38+
Vec3i pos = new Vec3i(baseVec.x + vec.x, baseVec.y + vec.y, baseVec.z + vec.z);
39+
return world.getBlock(pos.x,pos.y,pos.z);
40+
}
41+
3142
public TileEntity getTileEntity(WorldSource world, Vec3i baseVec){
3243
Vec3i pos = new Vec3i(baseVec.x + vec.x, baseVec.y + vec.y, baseVec.z + vec.z);
3344
return world.getBlockTileEntity(pos.x,pos.y,pos.z);

0 commit comments

Comments
 (0)