mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-10-26 14:24:40 +00:00
commit
014999a2a6
3 files changed
+9
-1
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
@@ -41,6 +41,7 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
public IIcon overlayIconPushPull;
|
||||
public IIcon overlayIconDisabled;
|
||||
public IIcon overlayIconNone;
|
||||
public IIcon overlayIconDirty;
|
||||
|
||||
public IIcon selectedFaceIcon;
|
||||
|
||||
@@ -132,6 +133,7 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
overlayIconDisabled = iIconRegister.registerIcon("enderio:overlays/disabled");
|
||||
overlayIconNone = iIconRegister.registerIcon("enderio:overlays/none");
|
||||
selectedFaceIcon = iIconRegister.registerIcon("enderio:overlays/selectedFace");
|
||||
overlayIconDirty = iIconRegister.registerIcon("enderio:overlays/dirt");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -149,7 +151,7 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
case PUSH_PULL:
|
||||
return overlayIconPushPull;
|
||||
default:
|
||||
return null;
|
||||
return tile.isDirty ? overlayIconDirty : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.machine;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -60,6 +61,8 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
|
||||
|
||||
private final ResourceLocation soundRes;
|
||||
|
||||
public boolean isDirty = false;
|
||||
|
||||
public static ResourceLocation getSoundFor(String sound) {
|
||||
return sound == null ? null : new ResourceLocation(EnderIO.DOMAIN + ":" + sound);
|
||||
}
|
||||
@@ -291,6 +294,9 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
|
||||
}
|
||||
|
||||
if(forceClientUpdate) {
|
||||
if (worldObj.rand.nextInt(1024) <= (isDirty ? 256 : 0)) {
|
||||
isDirty = !isDirty;
|
||||
}
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
forceClientUpdate = false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user