0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-20 01:12:13 +02:00

Eclipse auto cleanup

This commit is contained in:
Alexander01998 2023-10-25 14:38:50 +02:00
parent 5245b4d061
commit 7baf140537

View File

@ -25,8 +25,8 @@ import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.util.ItemUtils;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.ItemUtils;
@SearchTags({"auto sword"})
public final class AutoSwordHack extends Hack implements UpdateListener
@ -78,10 +78,11 @@ public final class AutoSwordHack extends Hack implements UpdateListener
&& MC.crosshairTarget.getType() == HitResult.Type.ENTITY)
{
Entity entity = ((EntityHitResult)MC.crosshairTarget).getEntity();
//check if entity is correct
if(!isCorrectEntity(entity))
return;
// check if entity is correct
if(!isCorrectEntity(entity))
return;
if(entity instanceof LivingEntity
&& ((LivingEntity)entity).getHealth() > 0)
setSlot();
@ -197,6 +198,7 @@ public final class AutoSwordHack extends Hack implements UpdateListener
return name;
}
}
private boolean isCorrectEntity(Entity entity)
{
Stream<Entity> stream = Stream.of(entity);
@ -205,4 +207,3 @@ public final class AutoSwordHack extends Hack implements UpdateListener
return stream.findFirst().isPresent();
}
}