Skip to content

Commit

Permalink
Improved client CPU usage related to air block
Browse files Browse the repository at this point in the history
  • Loading branch information
LemADEC committed Sep 7, 2015
1 parent 7145412 commit 1378097
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/cr0s/warpdrive/block/passive/BlockAir.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Random;

import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
Expand Down Expand Up @@ -126,6 +127,10 @@ public int tickRate(World par1World) {
*/
@Override
public void updateTick(World par1World, int x, int y, int z, Random par5Random) {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
return;
}

int concentration = par1World.getBlockMetadata(x, y, z);
boolean isInSpaceWorld = par1World.provider.dimensionId == WarpDriveConfig.G_SPACE_DIMENSION_ID || par1World.provider.dimensionId == WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID;

Expand All @@ -149,6 +154,7 @@ public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int
if (sideBlock == this) {
return false;
}

return world.isAirBlock(x, y, z);
}

Expand Down

0 comments on commit 1378097

Please sign in to comment.