Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/main/java/cam72cam/mod/world/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ public float getBlockHardness(Vec3i pos) {
return internal.getBlockState(pos.internal()).getBlockHardness(internal, pos.internal());
}

/** Get max redstone power surrounding this block */
/** Get max redstone power (strong and weak) surrounding this block */
public int getRedstone(Vec3i pos) {
int power = 0;
for (Facing facing : Facing.values()) {
Expand All @@ -578,6 +578,19 @@ public int getRedstone(Vec3i pos) {
return power;
}

/**
* Get max strong redstone power surrounding this block
* <p>
* Sometimes attempts to get weak power may trap us into infinite loop, use this in that circumstance
* */
public int getRedstoneDirect(Vec3i pos) {
int power = 0;
for (Facing facing : Facing.values()) {
power = Math.max(power, internal.getStrongPower(pos.offset(facing).internal(), facing.internal));
}
return power;
}

/** If the sky is visible at this position */
public boolean canSeeSky(Vec3i position) {
return internal.canSeeSky(position.internal());
Expand Down