package pneumaticCraft.common.sensor.pollSensors; import java.util.ArrayList; import java.util.List; import net.minecraft.client.gui.FontRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import org.lwjgl.util.Rectangle; import pneumaticCraft.api.universalSensor.IPollSensorSetting; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class WorldRainingSensor implements IPollSensorSetting{ @Override public String getSensorPath(){ return "dispenser/World/Is Raining"; } @Override public boolean needsTextBox(){ return false; } @Override public List<String> getDescription(){ List<String> text = new ArrayList<String>(); text.add(EnumChatFormatting.BLACK + "Emits a redstone signal if it's raining in the world."); return text; } @Override public int getPollFrequency(TileEntity te){ return 40; } @Override public int getRedstoneValue(World world, int x, int y, int z, int sensorRange, String textBoxText){ return world.isRaining() ? 15 : 0; } @Override @SideOnly(Side.CLIENT) public void drawAdditionalInfo(FontRenderer fontRenderer){} @Override public Rectangle needsSlot(){ return null; } }