// Path: src/main/java/openperipheral/addons/Config.java
// public class Config {
// 	@OnLineModifiable
// 	@ConfigProperty(category = "sensor", name = "rangeInStorm")
// 	public static int sensorRangeInStorm = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "sensor", name = "normalRange")
// 	public static int sensorRange = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "misc", comment = "Should turtles with OPA updates be visible in creative")
// 	public static boolean addTurtlesToCreative = true;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Should glasses listen to all chat (not just prefixed with $$)")
// 	public static boolean listenToAllChat = true;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Minimal difference in mouse position (in pixels) needed before drag event is sent to server")
// 	public static int minimalDragThreshold = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Minimal time (in ticks) between two drag events")
// 	public static int minimalDragPeriod = 10;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Default difference in mouse position (in pixels) needed before drag event is sent to server")
// 	public static int defaultDragThreshold = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Default time (in ticks) between two drag events")
// 	public static int defaultDragPeriod = 10;
// 
// }


import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import openmods.utils.WorldUtils;
import openperipheral.addons.Config;
package openperipheral.addons.sensors;


public class TileEntitySensor extends TileEntity implements ISensorEnvironment {

	private static final int ROTATION_SPEED = 3;

	private int rotation;

	public TileEntitySensor() {}

	public int getRotation() {
		return rotation;
	}

	@Override
	public void updateEntity() {
		rotation = (rotation + ROTATION_SPEED) % 360;
	}

	@Override
	public boolean isTurtle() {
		return false;
	}

	@Override
	public Vec3 getLocation() {
		return Vec3.createVectorHelper(xCoord, yCoord, zCoord);
	}

	@Override
	public World getWorld() {
		return worldObj;
	}

	@Override
	public int getSensorRange() {
		final World world = getWorld();
// Path: src/main/java/openperipheral/addons/Config.java
// public class Config {
// 	@OnLineModifiable
// 	@ConfigProperty(category = "sensor", name = "rangeInStorm")
// 	public static int sensorRangeInStorm = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "sensor", name = "normalRange")
// 	public static int sensorRange = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "misc", comment = "Should turtles with OPA updates be visible in creative")
// 	public static boolean addTurtlesToCreative = true;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Should glasses listen to all chat (not just prefixed with $$)")
// 	public static boolean listenToAllChat = true;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Minimal difference in mouse position (in pixels) needed before drag event is sent to server")
// 	public static int minimalDragThreshold = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Minimal time (in ticks) between two drag events")
// 	public static int minimalDragPeriod = 10;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Default difference in mouse position (in pixels) needed before drag event is sent to server")
// 	public static int defaultDragThreshold = 5;
// 
// 	@OnLineModifiable
// 	@ConfigProperty(category = "glasses", comment = "Default time (in ticks) between two drag events")
// 	public static int defaultDragPeriod = 10;
// 
// }


// Path: src/main/java/openperipheral/addons/sensors/TileEntitySensor.java
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import openmods.utils.WorldUtils;
import openperipheral.addons.Config;

package openperipheral.addons.sensors;


public class TileEntitySensor extends TileEntity implements ISensorEnvironment {

	private static final int ROTATION_SPEED = 3;

	private int rotation;

	public TileEntitySensor() {}

	public int getRotation() {
		return rotation;
	}

	@Override
	public void updateEntity() {
		rotation = (rotation + ROTATION_SPEED) % 360;
	}

	@Override
	public boolean isTurtle() {
		return false;
	}

	@Override
	public Vec3 getLocation() {
		return Vec3.createVectorHelper(xCoord, yCoord, zCoord);
	}

	@Override
	public World getWorld() {
		return worldObj;
	}

	@Override
	public int getSensorRange() {
		final World world = getWorld();
		return (world.isRaining() && world.isThundering())? Config.sensorRangeInStorm : Config.sensorRange;