first commit

This commit is contained in:
Cloudburst
2021-03-11 10:09:33 +01:00
commit 081fa3b235
22 changed files with 2036 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
package cloudburst.rejects.modules;
import meteordevelopment.orbit.EventHandler;
import minegame159.meteorclient.events.world.TickEvent;
import minegame159.meteorclient.modules.Module;
import minegame159.meteorclient.settings.BoolSetting;
import minegame159.meteorclient.settings.Setting;
import minegame159.meteorclient.settings.SettingGroup;
import minegame159.meteorclient.utils.entity.EntityUtils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import cloudburst.rejects.RejectCategory;
public class AntiBot extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Boolean> removeInvisible = sgGeneral.add(new BoolSetting.Builder()
.name("remove-invisible")
.description("Removes bot only if they are invisible.")
.defaultValue(true)
.build()
);
public AntiBot()
{
super(RejectCategory.Rejects, "anti-bot", "Detects and removes bots.");
}
@EventHandler
public void onTick(TickEvent.Post tickEvent)
{
for (Entity entity : mc.world.getEntities())
{
if (removeInvisible.get() && !entity.isInvisible()) continue;
if (isBot(entity)) entity.remove();
}
}
private boolean isBot(Entity entity)
{
if (entity == null) return false;
if (!(entity instanceof PlayerEntity)) return false;
// Gamemode check
return EntityUtils.getGameMode(((PlayerEntity)entity)) == null; // Assume bot if invalid gamemode
}
}