package teamblep.blepcore.common.tileentity.core;

import net.minecraft.util.ITickable;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class TileEntityAbstractTickable extends TileEntityAbstractBase implements ITickable
{
    @Override
    public void update()
    {
        if (getWorld().isRemote)
        {
            //noinspection MethodCallSideOnly
            if (updateClient())
            {
                notifyServer();
            }
        } else
        {
            //noinspection MethodCallSideOnly
            if (updateServer())
            {
                notifyClient();
            }
        }
    }

    /**
     * Update this TileEntity on the clientside. Used for things such as rendering and other client-only things.
     *
     * @return true if the server needs to be notified of isInventoryValid change.
     */
    @SideOnly(Side.CLIENT)
    public abstract boolean updateClient();

    /**
     * Update this TileEntity on the serverside. Used for all serverside block updates, such as processing items.
     *
     * @return true if the client needs to be notified of isInventoryValid change.
     */
    public abstract boolean updateServer();
}

@@ -81,16 +81,65 @@
 ckable;%0A
+import net.minecraftforge.common.MinecraftForge;%0A
 import n
@@ -227,16 +227,69 @@
 ideOnly;
+%0Aimport teamblep.blepcore.common.event.EventFastTick;
 %0A%0Apublic
@@ -385,16 +385,48 @@
 kable%0A%7B%0A
+    private long lastTime = 0;%0A%0A
     @Ove
@@ -474,16 +474,17 @@
     if (
+!
 getWorld
@@ -522,148 +522,398 @@
     
-//noinspection MethodCallSideOnly%0A            if (updateClient())%0A            %7B%0A                notifyServer();%0A            %7D%0A        %7D else
+long now = getWorld().getTotalWorldTime();%0A%0A            if (now == lastTime && !MinecraftForge.EVENT_BUS.post(new EventFastTick(this)))%0A            %7B%0A                getWorld().destroyBlock(getPos(), true);%0A            %7D%0A%0A            lastTime = now;%0A        %7D%0A        tick();%0A    %7D%0A%0A    /**%0A     * Ticks the tile entity.%0A     */%0A    public void tick()%0A    %7B%0A        if (getWorld().isRemote)
 %0A   
@@ -973,24 +973,63 @@
             
+updateClient();%0A        %7D%0A        else 
 if (updateSe
@@ -1036,36 +1036,32 @@
 rver())%0A        
-    
 %7B%0A              
@@ -1058,20 +1058,16 @@
         
- 
-   
 notifyCl
@@ -1074,30 +1074,16 @@
 ient();%0A
-            %7D%0A
         

Implements the new event