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 pneumaticCraft.common.remote.GlobalVariableManager; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class WorldGlobalVariableSensor implements IPollSensorSetting{ @Override public String getSensorPath(){ return "dispenser/World/Global variable"; } @Override public boolean needsTextBox(){ return true; } @Override public List<String> getDescription(){ List<String> text = new ArrayList<String>(); text.add(EnumChatFormatting.BLACK + "Emits a redstone signal when the global variable specified its X position is not equal to 0"); return text; } @Override public int getPollFrequency(TileEntity te){ return 1; } @Override public int getRedstoneValue(World world, int x, int y, int z, int sensorRange, String textBoxText){ return GlobalVariableManager.getInstance().getBoolean(textBoxText) ? 15 : 0; } @Override @SideOnly(Side.CLIENT) public void drawAdditionalInfo(FontRenderer fontRenderer){} @Override public Rectangle needsSlot(){ return null; } }