<commit_before>package info.u_team.u_team_core.gui.render;

import java.util.function.Supplier;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.*;
import net.minecraft.client.gui.*;
import net.minecraft.util.math.MathHelper;

public class ScrollingTextRender extends ScalingTextRender {
	
	protected int width;
	protected float stepSize;
	protected int speedTime;
	protected int waitTime;
	
	protected float moveDifference = 0;
	protected long lastTime = 0;
	protected State state = State.WAITING;
	
	public ScrollingTextRender(Supplier<FontRenderer> fontRenderSupplier, Supplier<String> textSupplier) {
		super(fontRenderSupplier, textSupplier);
		width = 100;
		stepSize = 1;
		speedTime = 20;
		waitTime = 4000;
	}
	
	public void setWidth(int width) {
		this.width = width;
	}
	
	public int getWidth() {
		return width;
	}
	
	public void setStepSize(float stepSize) {
		this.stepSize = stepSize;
	}
	
	public float getStepSize() {
		return stepSize;
	}
	
	public void setSpeedTime(int speedtime) {
		this.speedTime = speedtime;
	}
	
	public int getSpeedTime() {
		return speedTime;
	}
	
	public void setWaitTime(int waittime) {
		this.waitTime = waittime;
	}
	
	public int getWaitTime() {
		return waitTime;
	}
	
	@Override
	protected void updatedText() {
		state = State.WAITING;
		moveDifference = 0;
		lastTime = 0;
	}
	
	@Override
	public void draw(float x, float y) {
		final Minecraft minecraft = Minecraft.getInstance();
		final MainWindow window = minecraft.getMainWindow();
		
		final double scaleFactor = window.getGuiScaleFactor();
		
		final int nativeX = MathHelper.ceil(x * scaleFactor);
		final int nativeY = MathHelper.ceil(y * scaleFactor);
		
		final int nativeWidth = MathHelper.ceil(width * scaleFactor);
		final int nativeHeight = MathHelper.ceil((fontRenderSupplier.get().FONT_HEIGHT + 1) * scale * scaleFactor);
		
		GL11.glPushMatrix();
		GL11.glEnable(GL11.GL_SCISSOR_TEST);
		
		GL11.glScissor(nativeX, window.getHeight() - (nativeY + nativeHeight), nativeWidth, nativeHeight);
		//AbstractGui.fill(0, 0, window.getScaledWidth(), window.getScaledHeight(), 0xFF00FF00); // test scissor
		
		super.draw(getMovingX(x), y + 2);
		<commit_msg>Fix import<commit_after>package info.u_team.u_team_core.gui.render;

import java.util.function.Supplier;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.*;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.util.math.MathHelper;

public class ScrollingTextRender extends ScalingTextRender {
	
	protected int width;
	protected float stepSize;
	protected int speedTime;
	protected int waitTime;
	
	protected float moveDifference = 0;
	protected long lastTime = 0;
	protected State state = State.WAITING;
	
	public ScrollingTextRender(Supplier<FontRenderer> fontRenderSupplier, Supplier<String> textSupplier) {
		super(fontRenderSupplier, textSupplier);
		width = 100;
		stepSize = 1;
		speedTime = 20;
		waitTime = 4000;
	}
	
	public void setWidth(int width) {
		this.width = width;
	}
	
	public int getWidth() {
		return width;
	}
	
	public void setStepSize(float stepSize) {
		this.stepSize = stepSize;
	}
	
	public float getStepSize() {
		return stepSize;
	}
	
	public void setSpeedTime(int speedtime) {
		this.speedTime = speedtime;
	}
	
	public int getSpeedTime() {
		return speedTime;
	}
	
	public void setWaitTime(int waittime) {
		this.waitTime = waittime;
	}
	
	public int getWaitTime() {
		return waitTime;
	}
	
	@Override
	protected void updatedText() {
		state = State.WAITING;
		moveDifference = 0;
		lastTime = 0;
	}
	
	@Override
	public void draw(float x, float y) {
		final Minecraft minecraft = Minecraft.getInstance();
		final MainWindow window = minecraft.getMainWindow();
		
		final double scaleFactor = window.getGuiScaleFactor();
		
		final int nativeX = MathHelper.ceil(x * scaleFactor);
		final int nativeY = MathHelper.ceil(y * scaleFactor);
		
		final int nativeWidth = MathHelper.ceil(width * scaleFactor);
		final int nativeHeight = MathHelper.ceil((fontRenderSupplier.get().FONT_HEIGHT + 1) * scale * scaleFactor);
		
		GL11.glPushMatrix();
		GL11.glEnable(GL11.GL_SCISSOR_TEST);
		
		GL11.glScissor(nativeX, window.getHeight() - (nativeY + nativeHeight), nativeWidth, nativeHeight);
		// AbstractGui.fill(0, 0, window.getScaledWidth(), window.getScaledHeight(), 0xFF00FF00); // test scissor
		
		super.draw(getMovingX(x), y + 2);
		
{'fraction_non_alphanumeric': 0.10327455919395466, 'fraction_numerical': 0.015113350125944584, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1375250', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1401, 'n_words': 339}