mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 07:36:01 +00:00
Hopefully fixed the transmitter network halt issue. Provide feedback!
This commit is contained in:
1 parent
dcf7d7772a
commit
0819c0ad5f
2 files changed
+34
-9
No files matched your search
@@ -669,6 +669,30 @@ public final class MekanismUtils
|
||||
{
|
||||
return def * Math.pow(Mekanism.maxUpgradeMultiplier, mgmt.getEnergyMultiplier(itemStack)/8.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* A better "isBlockIndirectlyGettingPowered()" that doesn't load chunks
|
||||
* @param world - the world to perform the check in
|
||||
* @param coord - the coordinate of the block performing the check
|
||||
* @return if the block is indirectly getting powered by LOADED chunks
|
||||
*/
|
||||
public static boolean isGettingPowered(World world, Coord4D coord)
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D sideCoord = coord.getFromSide(side);
|
||||
|
||||
if(sideCoord.exists(world))
|
||||
{
|
||||
if(world.getIndirectPowerLevelTo(sideCoord.xCoord, sideCoord.yCoord, sideCoord.zCoord, side.ordinal()) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Places a fake bounding block at the defined location.
|
||||
|
||||
Reference in new issue
Block a user