Начинающий
			
			
				
					
				
			
		- Статус
- Оффлайн
- Регистрация
- 14 Янв 2024
- Сообщения
- 87
- Реакции
- 0
- Выберите загрузчик игры
- Fabric
 
сделал прицел с норм настройками, нигде еще не видел такого
ss
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
жду оценку в комментарии
				
			ss
	Пожалуйста, авторизуйтесь для просмотра ссылки.
			
				Java:
			
		
		
		package wtf.dart.functions.impl.render;
import com.google.common.eventbus.Subscribe;
import wtf.dart.events.EventDisplay;
import wtf.dart.functions.api.Category;
import wtf.dart.functions.api.Function;
import wtf.dart.functions.api.FunctionRegister;
import wtf.dart.functions.settings.impl.BooleanSetting;
import wtf.dart.functions.settings.impl.ModeSetting;
import wtf.dart.functions.settings.impl.SliderSetting;
import wtf.dart.utils.render.DisplayUtils;
import net.minecraft.client.settings.PointOfView;
import java.awt.*;
@FunctionRegister(name = "Crosshair", type = Category.Render, description = "Добавляет кастомный прицел")
public class Crosshair extends Function {
    private final ModeSetting crosshairType = new ModeSetting("Тип прицела", "Обычный", "Обычный", "T-образный");
    private final BooleanSetting showOutline = new BooleanSetting("Обводка", true);
    private final BooleanSetting dynamicGap = new BooleanSetting("Динамический зазор", true);
    private final BooleanSetting highlightTarget = new BooleanSetting("Подсветка цели", true);
    private final SliderSetting thickness = new SliderSetting("Толщина", 1.0f, 0.5f, 5.0f, 0.1f);
    private final SliderSetting length = new SliderSetting("Длина", 3.0f, 1.0f, 10.0f, 0.5f);
    private final SliderSetting baseGap = new SliderSetting("Базовый зазор", 2.0f, 0.0f, 10.0f, 0.5f);
    private final SliderSetting maxGapIncrease = new SliderSetting("Увеличение зазора", 8.0f, 0.0f, 15.0f, 0.5f);
    private final int outlineColor = Color.BLACK.getRGB();
    private final int entityColor = Color.RED.getRGB();
    public Crosshair() {
        addSettings(crosshairType, showOutline, dynamicGap, highlightTarget,
                thickness,
                length, baseGap,
                maxGapIncrease);
    }
    @Subscribe
    public void onDisplay(EventDisplay e) {
        if (mc.player == null || mc.world == null || e.getType() != EventDisplay.Type.POST) {
            return;
        }
        float x = mc.getMainWindow().getScaledWidth() / 2f;
        float y = mc.getMainWindow().getScaledHeight() / 2f;
        if (mc.gameSettings.getPointOfView() != PointOfView.FIRST_PERSON) return;
        float thicknessValue = thickness.get();
        float lengthValue = length.get();
        float baseGapValue = baseGap.get();
        float maxGapIncreaseValue = maxGapIncrease.get();
        boolean useDynamicGap = dynamicGap.get();
        boolean shouldHighlight = highlightTarget.get();
        boolean shouldShowOutline = showOutline.get();
        boolean isTCrosshair = crosshairType.get().equals("T-образный");
        float cooldown = useDynamicGap ? (1 - mc.player.getCooledAttackStrength(0)) : 0;
        float gap = baseGapValue + (useDynamicGap ? maxGapIncreaseValue * cooldown : 0);
        int color = (shouldHighlight && mc.pointedEntity != null) ? entityColor : -1;
        if (isTCrosshair) {
            if (shouldShowOutline) {
                drawOutlined(x - lengthValue, y - thicknessValue/2, lengthValue * 2, thicknessValue, color);
                drawOutlined(x - thicknessValue/2, y, thicknessValue, lengthValue + gap, color);
            } else {
                DisplayUtils.drawRectW(x - lengthValue, y - thicknessValue/2, lengthValue * 2, thicknessValue, color);
                DisplayUtils.drawRectW(x - thicknessValue/2, y, thicknessValue, lengthValue + gap, color);
            }
        } else {
            if (shouldShowOutline) {
                drawOutlined(x - thicknessValue / 2, y - gap - lengthValue, thicknessValue, lengthValue, color);
                drawOutlined(x - thicknessValue / 2, y + gap, thicknessValue, lengthValue, color);
                drawOutlined(x - gap - lengthValue, y - thicknessValue / 2, lengthValue, thicknessValue, color);
                drawOutlined(x + gap, y - thicknessValue / 2, lengthValue, thicknessValue, color);
            } else {
                DisplayUtils.drawRectW(x - thicknessValue / 2, y - gap - lengthValue, thicknessValue, lengthValue, color);
                DisplayUtils.drawRectW(x - thicknessValue / 2, y + gap, thicknessValue, lengthValue, color);
                DisplayUtils.drawRectW(x - gap - lengthValue, y - thicknessValue / 2, lengthValue, thicknessValue, color);
                DisplayUtils.drawRectW(x + gap, y - thicknessValue / 2, lengthValue, thicknessValue, color);
            }
        }
    }
    private void drawOutlined(
            final float x,
            final float y,
            final float w,
            final float h,
            final int hex
    ) {
        DisplayUtils.drawRectW(x - 0.5, y - 0.5, w + 1, h + 1, outlineColor);
        DisplayUtils.drawRectW(x, y, w, h, hex);
    }
}жду оценку в комментарии

 
				 
	 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		