Auto Reflection Based TileEvents.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package appeng.tile.misc;
|
||||
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.events.AETileEventHandler;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -16,28 +16,15 @@ public class TileLightDetector extends AEBaseTile
|
||||
return lastLight > 0;
|
||||
}
|
||||
|
||||
class LightDetectorHandler extends AETileEventHandler
|
||||
@TileEvent(TileEventType.TICK)
|
||||
public void Tick_TileLightDetector()
|
||||
{
|
||||
|
||||
public LightDetectorHandler() {
|
||||
super( TileEventType.TICK );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Tick()
|
||||
lastCheck++;
|
||||
if ( lastCheck > 30 )
|
||||
{
|
||||
lastCheck++;
|
||||
if ( lastCheck > 30 )
|
||||
{
|
||||
lastCheck = 0;
|
||||
updateLight();
|
||||
}
|
||||
lastCheck = 0;
|
||||
updateLight();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public TileLightDetector() {
|
||||
addNewHandler( new LightDetectorHandler() );
|
||||
}
|
||||
|
||||
public void updateLight()
|
||||
|
||||
Reference in New Issue
Block a user