forked from RepoMirrors/kami-blue
Merge remote-tracking branch 'origin/feature/master' into feature/master
This commit is contained in:
commit
e39939ef35
|
@ -0,0 +1,17 @@
|
|||
package me.zeroeightsix.kami.event.events;
|
||||
|
||||
import me.zeroeightsix.kami.event.KamiEvent;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class EntityUseTotemEvent extends KamiEvent {
|
||||
private Entity entity;
|
||||
|
||||
public EntityUseTotemEvent(Entity entity) {
|
||||
super();
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
public Entity getEntity() {
|
||||
return entity;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package me.zeroeightsix.kami.module.modules.combat;
|
||||
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.event.events.PacketEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.module.ModuleManager;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.network.play.server.SPacketEntityStatus;
|
||||
|
||||
import static me.zeroeightsix.kami.module.modules.gui.InfoOverlay.getItems;
|
||||
|
||||
/**
|
||||
* @author S-B99
|
||||
* Created by S-B99 on 25/03/20
|
||||
*
|
||||
* Event / Packet mode taken from CliNet
|
||||
* https://github.com/DarkiBoi/CliNet/blob/fd225a5c8cc373974b0c9a3457acbeed206e8cca/src/main/java/me/zeroeightsix/kami/module/modules/combat/TotemPopCounter.java
|
||||
*/
|
||||
@Module.Info(name = "AntiChainPop", description = "Enables Surround when popping a totem", category = Module.Category.COMBAT)
|
||||
public class AntiChainPop extends Module {
|
||||
private Setting<Mode> mode = register(Settings.e("Mode", Mode.PACKET));
|
||||
private int totems = 0;
|
||||
|
||||
@EventHandler
|
||||
public Listener<PacketEvent.Receive> selfPopListener = new Listener<>(event -> {
|
||||
if (mc.player == null || !mode.getValue().equals(Mode.PACKET)) return;
|
||||
|
||||
if (event.getPacket() instanceof SPacketEntityStatus) {
|
||||
SPacketEntityStatus packet = (SPacketEntityStatus) event.getPacket();
|
||||
if (packet.getOpCode() == 35) {
|
||||
Entity entity = packet.getEntity(mc.world);
|
||||
if (entity.getDisplayName().equals(mc.player.getDisplayName()))
|
||||
packetMode();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
public void onUpdate() {
|
||||
if (mc.player == null) disable();
|
||||
if (mode.getValue().equals(Mode.ITEMS)) {
|
||||
itemMode();
|
||||
}
|
||||
}
|
||||
|
||||
private void itemMode() {
|
||||
int old = totems;
|
||||
if (getItems(Items.TOTEM_OF_UNDYING) < old) {
|
||||
Surround surround = (Surround) ModuleManager.getModuleByName("Surround");
|
||||
surround.autoDisable.setValue(true);
|
||||
surround.enable();
|
||||
}
|
||||
totems = getItems(Items.TOTEM_OF_UNDYING);
|
||||
}
|
||||
|
||||
private void packetMode() {
|
||||
Surround surround = (Surround) ModuleManager.getModuleByName("Surround");
|
||||
surround.autoDisable.setValue(true);
|
||||
surround.enable();
|
||||
}
|
||||
|
||||
public void onEnable() { totems = 0; }
|
||||
public void onDisable() { totems = 0; }
|
||||
private enum Mode { ITEMS, PACKET }
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package me.zeroeightsix.kami.module.modules.combat;
|
||||
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.event.events.GuiScreenEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.module.ModuleManager;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import net.minecraft.client.gui.GuiGameOver;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
|
||||
/**
|
||||
* @author polymer
|
||||
* @author cookiedragon234
|
||||
* Updated by polymer 10 March 2020
|
||||
* Updated by S-B99 on 10/04/20
|
||||
*/
|
||||
@Module.Info(name = "AutoEZ", category = Module.Category.COMBAT, description = "Sends an insult in chat after killing someone")
|
||||
public class AutoEZ extends Module {
|
||||
private Setting<Mode> mode = register(Settings.e("Mode", Mode.ONTOP));
|
||||
EntityPlayer focus;
|
||||
int hasBeenCombat;
|
||||
|
||||
public enum Mode {
|
||||
GG("gg, "),
|
||||
ONTOP("KAMI BLUE on top! ez "),
|
||||
EZD("You just got ez'd "),
|
||||
EZ_HYPIXEL("E Z Win "),
|
||||
NAENAE("You just got naenae'd by kami blue plus, ");
|
||||
|
||||
private String text;
|
||||
|
||||
Mode(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
}
|
||||
|
||||
private String getText(Mode m) {
|
||||
return m.text;
|
||||
}
|
||||
|
||||
@EventHandler public Listener<AttackEntityEvent> livingDeathEventListener = new Listener<>(event -> {
|
||||
if (event.getTarget() instanceof EntityPlayer) {
|
||||
focus = (EntityPlayer) event.getTarget();
|
||||
if (event.getEntityPlayer().getUniqueID() == mc.player.getUniqueID()) {
|
||||
if (focus.getHealth() <= 0.0 || focus.isDead || !mc.world.playerEntities.contains(focus)) {
|
||||
mc.player.sendChatMessage(getText(mode.getValue()) + event.getTarget().getName());
|
||||
return;
|
||||
}
|
||||
hasBeenCombat = 1000;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@EventHandler
|
||||
public Listener<GuiScreenEvent.Displayed> listener = new Listener<>(event -> {
|
||||
if (!(event.getScreen() instanceof GuiGameOver)) return;
|
||||
if (mc.player.getHealth() > 0) {
|
||||
hasBeenCombat = 0;
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (hasBeenCombat > 0 && (focus.getHealth() <= 0.0f || focus.isDead || !mc.world.playerEntities.contains(this.focus))) {
|
||||
if (ModuleManager.getModuleByName("AutoEZ").isEnabled()) {
|
||||
mc.player.sendChatMessage(getText(mode.getValue())+focus.getName());
|
||||
}
|
||||
hasBeenCombat = 0;
|
||||
}
|
||||
--hasBeenCombat;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +1,29 @@
|
|||
package me.zeroeightsix.kami.module.modules.combat;
|
||||
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ClickType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import static me.zeroeightsix.kami.module.modules.gui.InfoOverlay.getItems;
|
||||
|
||||
/**
|
||||
* Created by 086 on 22/01/2018.
|
||||
* Updated by S-B99 on 24/02/20
|
||||
* Updated by S-B99 on 25/03/20
|
||||
*/
|
||||
@Module.Info(name = "AutoTotem", category = Module.Category.COMBAT, description = "Refills your offhand with totems")
|
||||
public class AutoTotem extends Module {
|
||||
@Module.Info(name = "AutoOffhand", category = Module.Category.COMBAT, description = "Refills your offhand with totems or other items")
|
||||
public class AutoOffhand extends Module {
|
||||
private Setting<Mode> modeSetting = register(Settings.e("Mode", Mode.REPLACE_OFFHAND));
|
||||
private Setting<Double> healthSetting = register(Settings.doubleBuilder("Max replace health").withValue(20.0).withVisibility(v -> modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)));
|
||||
private Setting<Boolean> smartOffhand = register(Settings.booleanBuilder("Custom Item").withValue(false).withVisibility(v -> modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)));
|
||||
private Setting<Double> healthSetting = register(Settings.doubleBuilder("Custom Item Health").withValue(14.0).withVisibility(v -> smartOffhand.getValue() && modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)));
|
||||
private Setting<CustomItem> smartItemSetting = register(Settings.enumBuilder(CustomItem.class).withName("Item").withValue(CustomItem.GAPPLE).withVisibility(v -> smartOffhand.getValue()).build());
|
||||
|
||||
private enum Mode {
|
||||
NEITHER, REPLACE_OFFHAND, INVENTORY
|
||||
}
|
||||
private enum Mode { NEITHER, REPLACE_OFFHAND, INVENTORY;}
|
||||
private enum CustomItem { CRYSTAL, GAPPLE }
|
||||
|
||||
int totems;
|
||||
boolean moving = false;
|
||||
|
@ -28,7 +31,6 @@ public class AutoTotem extends Module {
|
|||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (!passHealthCheck()) return;
|
||||
if (!modeSetting.getValue().equals(Mode.INVENTORY) && mc.currentScreen instanceof GuiContainer)
|
||||
return; // this stops autototem from running if you're in a chest or something
|
||||
if (returnI) {
|
||||
|
@ -42,10 +44,11 @@ public class AutoTotem extends Module {
|
|||
mc.playerController.windowClick(0, t < 9 ? t + 36 : t, 0, ClickType.PICKUP, mc.player);
|
||||
returnI = false;
|
||||
}
|
||||
totems = mc.player.inventory.mainInventory.stream().filter(itemStack -> itemStack.getItem() == Items.TOTEM_OF_UNDYING).mapToInt(ItemStack::getCount).sum();
|
||||
if (mc.player.getHeldItemOffhand().getItem() == Items.TOTEM_OF_UNDYING) totems++;
|
||||
totems = mc.player.inventory.mainInventory.stream().filter(itemStack -> itemStack.getItem() == settingToItem()).mapToInt(ItemStack::getCount).sum();
|
||||
if (mc.player.getHeldItemOffhand().getItem() == settingToItem()) totems++;
|
||||
else {
|
||||
if (!modeSetting.getValue().equals(Mode.REPLACE_OFFHAND) && !mc.player.getHeldItemOffhand().isEmpty) return;
|
||||
if (!modeSetting.getValue().equals(Mode.REPLACE_OFFHAND) && !mc.player.getHeldItemOffhand().isEmpty)
|
||||
return;
|
||||
if (moving) {
|
||||
mc.playerController.windowClick(0, 45, 0, ClickType.PICKUP, mc.player);
|
||||
moving = false;
|
||||
|
@ -56,7 +59,7 @@ public class AutoTotem extends Module {
|
|||
if (totems == 0) return;
|
||||
int t = -1;
|
||||
for (int i = 0; i < 45; i++)
|
||||
if (mc.player.inventory.getStackInSlot(i).getItem() == Items.TOTEM_OF_UNDYING) {
|
||||
if (mc.player.inventory.getStackInSlot(i).getItem() == settingToItem()) {
|
||||
t = i;
|
||||
break;
|
||||
}
|
||||
|
@ -76,6 +79,17 @@ public class AutoTotem extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
private Item settingToItem() {
|
||||
if (!smartOffhand.getValue() || passHealthCheck()) return Items.TOTEM_OF_UNDYING;
|
||||
switch (smartItemSetting.getValue()) {
|
||||
case GAPPLE:
|
||||
return Items.GOLDEN_APPLE;
|
||||
case CRYSTAL:
|
||||
return Items.END_CRYSTAL;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean passHealthCheck() {
|
||||
if (modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)) {
|
||||
return mc.player.getHealth() + mc.player.getAbsorptionAmount() <= healthSetting.getValue();
|
||||
|
@ -85,6 +99,6 @@ public class AutoTotem extends Module {
|
|||
|
||||
@Override
|
||||
public String getHudInfo() {
|
||||
return String.valueOf(totems);
|
||||
return "" + getItems(settingToItem());
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import me.zeroeightsix.kami.command.Command;
|
|||
import me.zeroeightsix.kami.event.events.PacketEvent;
|
||||
import me.zeroeightsix.kami.event.events.RenderEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.module.ModuleManager;
|
||||
import me.zeroeightsix.kami.module.modules.render.Tracers;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
|
@ -34,29 +35,56 @@ import org.lwjgl.opengl.GL11;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static me.zeroeightsix.kami.module.modules.gui.InfoOverlay.getItems;
|
||||
import static me.zeroeightsix.kami.util.ColourConverter.rgbToInt;
|
||||
import static me.zeroeightsix.kami.util.ColourConverter.toF;
|
||||
import static me.zeroeightsix.kami.util.EntityUtil.calculateLookAt;
|
||||
|
||||
/**
|
||||
* Created by 086 on 28/12/2017.
|
||||
* Updated 3 December 2019 by hub
|
||||
* Updated 8 March 2020 by polymer
|
||||
* Updated by qther on 27/03/20
|
||||
* Updated by S-B99 on 27/03/20
|
||||
*/
|
||||
@Module.Info(name = "CrystalAura", category = Module.Category.COMBAT, description = "Places End Crystals to kill enemies")
|
||||
public class CrystalAura extends Module {
|
||||
|
||||
private Setting<Boolean> defaultSetting = register(Settings.b("Defaults", false));
|
||||
private Setting<Boolean> autoSwitch = register(Settings.b("Auto Switch", true));
|
||||
private Setting<Boolean> players = register(Settings.b("Players", true));
|
||||
private Setting<Boolean> mobs = register(Settings.b("Mobs", false));
|
||||
private Setting<Boolean> animals = register(Settings.b("Animals", false));
|
||||
private Setting<Boolean> place = register(Settings.b("Place", false));
|
||||
private Setting<Boolean> explode = register(Settings.b("Explode", false));
|
||||
private Setting<Double> range = register(Settings.d("Range", 4.0));
|
||||
private Setting<Boolean> tracer = register(Settings.b("Tracer", true));
|
||||
private Setting<Boolean> antiWeakness = register(Settings.b("Anti Weakness", false));
|
||||
private Setting<Boolean> checkAbsorption = register(Settings.b("Check Absorption", true));
|
||||
private Setting<Page> p = register(Settings.enumBuilder(Page.class).withName("Page").withValue(Page.ONE).build());
|
||||
/* Page One */
|
||||
private Setting<ExplodeBehavior> explodeBehavior = register(Settings.enumBuilder(ExplodeBehavior.class).withName("Explode Behavior").withValue(ExplodeBehavior.ALWAYS).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<PlaceBehavior> placeBehavior = register(Settings.enumBuilder(PlaceBehavior.class).withName("Place Behavior").withValue(PlaceBehavior.TRADITIONAL).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Boolean> autoSwitch = register(Settings.booleanBuilder("Auto Switch").withValue(true).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Boolean> place = register(Settings.booleanBuilder("Place").withValue(false).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Boolean> explode = register(Settings.booleanBuilder("Explode").withValue(false).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Boolean> checkAbsorption = register(Settings.booleanBuilder("Check Absorption").withValue(true).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
public Setting<Double> range = register(Settings.doubleBuilder("Range").withMinimum(1.0).withValue(4.0).withMaximum(10.0).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Double> delay = register(Settings.doubleBuilder("Hit Delay").withMinimum(0.0).withValue(5.0).withMaximum(10.0).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Integer> hitAttempts = register(Settings.integerBuilder("Hit Attempts").withValue(-1).withMinimum(-1).withMaximum(20).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Double> minDmg = register(Settings.doubleBuilder("Minimum Damage").withMinimum(0.0).withValue(0.0).withMaximum(32.0).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Boolean> sneakEnable = register(Settings.booleanBuilder("Sneak Surround").withValue(true).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
private Setting<Boolean> placePriority = register(Settings.booleanBuilder("Prioritize Manual").withValue(false).withVisibility(v -> p.getValue().equals(Page.ONE)).build());
|
||||
/* Page Two */
|
||||
private Setting<Boolean> antiWeakness = register(Settings.booleanBuilder("Anti Weakness").withValue(false).withVisibility(v -> p.getValue().equals(Page.TWO)).build());
|
||||
private Setting<Boolean> noToolExplode = register(Settings.booleanBuilder("No Tool Explode").withValue(true).withVisibility(v -> !antiWeakness.getValue() && p.getValue().equals(Page.TWO)).build());
|
||||
private Setting<Boolean> players = register(Settings.booleanBuilder("Players").withValue(true).withVisibility(v -> p.getValue().equals(Page.TWO)).build());
|
||||
private Setting<Boolean> mobs = register(Settings.booleanBuilder("Mobs").withValue(false).withVisibility(v -> p.getValue().equals(Page.TWO)).build());
|
||||
private Setting<Boolean> animals = register(Settings.booleanBuilder("Animals").withValue(false).withVisibility(v -> p.getValue().equals(Page.TWO)).build());
|
||||
private Setting<Boolean> tracer = register(Settings.booleanBuilder("Tracer").withValue(true).withVisibility(v -> p.getValue().equals(Page.TWO)).build());
|
||||
private Setting<Boolean> customColours = register(Settings.booleanBuilder("Custom Colours").withValue(true).withVisibility(v -> p.getValue().equals(Page.TWO)).build());
|
||||
private Setting<Integer> aBlock = register(Settings.integerBuilder("Block Transparency").withMinimum(0).withValue(44).withMaximum(255).withVisibility(v -> p.getValue().equals(Page.TWO) && customColours.getValue()).build());
|
||||
private Setting<Integer> aTracer = register(Settings.integerBuilder("Tracer Transparency").withMinimum(0).withValue(200).withMaximum(255).withVisibility(v -> p.getValue().equals(Page.TWO) && customColours.getValue()).build());
|
||||
private Setting<Integer> r = register(Settings.integerBuilder("Red").withMinimum(0).withValue(155).withMaximum(255).withVisibility(v -> p.getValue().equals(Page.TWO) && customColours.getValue()).build());
|
||||
private Setting<Integer> g = register(Settings.integerBuilder("Green").withMinimum(0).withValue(144).withMaximum(255).withVisibility(v -> p.getValue().equals(Page.TWO) && customColours.getValue()).build());
|
||||
private Setting<Integer> b = register(Settings.integerBuilder("Blue").withMinimum(0).withValue(255).withMaximum(255).withVisibility(v -> p.getValue().equals(Page.TWO) && customColours.getValue()).build());
|
||||
private Setting<Boolean> statusMessages = register(Settings.booleanBuilder("Status Messages").withValue(false).withVisibility(v -> p.getValue().equals(Page.TWO)).build());
|
||||
|
||||
private enum ExplodeBehavior { HOLE_ONLY, PREVENT_SUICIDE, LEFT_CLICK_ONLY, ALWAYS }
|
||||
private enum PlaceBehavior { MULTI, TRADITIONAL }
|
||||
private enum Page { ONE, TWO }
|
||||
|
||||
private BlockPos render;
|
||||
private Entity renderEnt;
|
||||
|
@ -66,34 +94,74 @@ public class CrystalAura extends Module {
|
|||
private boolean switchCoolDown = false;
|
||||
private boolean isAttacking = false;
|
||||
private int oldSlot = -1;
|
||||
private int newSlot;
|
||||
|
||||
@Override
|
||||
private static EntityEnderCrystal lastCrystal;
|
||||
private static List<EntityEnderCrystal> ignoredCrystals = new ArrayList<>();
|
||||
private static int hitTries = 0;
|
||||
|
||||
public void onUpdate() {
|
||||
if (defaultSetting.getValue()) {
|
||||
explodeBehavior.setValue(ExplodeBehavior.ALWAYS);
|
||||
placeBehavior.setValue(PlaceBehavior.TRADITIONAL);
|
||||
autoSwitch.setValue(true);
|
||||
place.setValue(false);
|
||||
explode.setValue(false);
|
||||
checkAbsorption.setValue(true);
|
||||
range.setValue(4.0);
|
||||
delay.setValue(5.0);
|
||||
hitAttempts.setValue(-1);
|
||||
minDmg.setValue(0.0);
|
||||
sneakEnable.setValue(true);
|
||||
placePriority.setValue(false);
|
||||
|
||||
antiWeakness.setValue(false);
|
||||
noToolExplode.setValue(true);
|
||||
players.setValue(true);
|
||||
mobs.setValue(false);
|
||||
animals.setValue(false);
|
||||
place.setValue(false);
|
||||
explode.setValue(false);
|
||||
range.setValue(4.0);
|
||||
tracer.setValue(true);
|
||||
antiWeakness.setValue(false);
|
||||
checkAbsorption.setValue(true);
|
||||
customColours.setValue(true);
|
||||
aBlock.setValue(44);
|
||||
aTracer.setValue(200);
|
||||
r.setValue(155);
|
||||
g.setValue(144);
|
||||
b.setValue(255);
|
||||
statusMessages.setValue(false);
|
||||
|
||||
defaultSetting.setValue(false);
|
||||
Command.sendChatMessage(getChatName() + " Set to defaults!");
|
||||
Command.sendChatMessage(getChatName() + " Close and reopen the " + getName() + " settings menu to see changes");
|
||||
}
|
||||
|
||||
if (mc.player == null) {
|
||||
resetHitAttempts();
|
||||
return;
|
||||
}
|
||||
|
||||
resetHitAttempts(hitAttempts.getValue() == -1);
|
||||
|
||||
int holeBlocks = 0;
|
||||
|
||||
Vec3d[] holeOffset = {
|
||||
mc.player.getPositionVector().add(1, 0, 0),
|
||||
mc.player.getPositionVector().add(-1, 0, 0),
|
||||
mc.player.getPositionVector().add(0, 0, 1),
|
||||
mc.player.getPositionVector().add(0, 0, -1),
|
||||
mc.player.getPositionVector().add(0, -1, 0)
|
||||
};
|
||||
|
||||
EntityEnderCrystal crystal = mc.world.loadedEntityList.stream()
|
||||
.filter(entity -> entity instanceof EntityEnderCrystal)
|
||||
.filter(entity -> !ignored(entity))
|
||||
.map(entity -> (EntityEnderCrystal) entity)
|
||||
.min(Comparator.comparing(c -> mc.player.getDistance(c)))
|
||||
.orElse(null);
|
||||
if (explode.getValue() && crystal != null && mc.player.getDistance(crystal) <= range.getValue()) {
|
||||
//Added delay to stop ncp from flagging "hitting too fast"
|
||||
if (((System.nanoTime() / 1000000) - systemTime) >= 250) {
|
||||
|
||||
|
||||
|
||||
if (explode.getValue() && crystal != null && mc.player.getDistance(crystal) <= range.getValue() && passSwordCheck()) {
|
||||
// Added delay to stop ncp from flagging "hitting too fast"
|
||||
if (((System.nanoTime() / 1000000f) - systemTime) >= 25*delay.getValue()) {
|
||||
if (antiWeakness.getValue() && mc.player.isPotionActive(MobEffects.WEAKNESS)) {
|
||||
if (!isAttacking) {
|
||||
// save initial player hand
|
||||
|
@ -101,7 +169,7 @@ public class CrystalAura extends Module {
|
|||
isAttacking = true;
|
||||
}
|
||||
// search for sword and tools in hotbar
|
||||
newSlot = -1;
|
||||
int newSlot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack stack = Wrapper.getPlayer().inventory.getStackInSlot(i);
|
||||
if (stack == ItemStack.EMPTY) {
|
||||
|
@ -122,12 +190,42 @@ public class CrystalAura extends Module {
|
|||
switchCoolDown = true;
|
||||
}
|
||||
}
|
||||
lookAtPacket(crystal.posX, crystal.posY, crystal.posZ, mc.player);
|
||||
mc.playerController.attackEntity(mc.player, crystal);
|
||||
mc.player.swingArm(EnumHand.MAIN_HAND);
|
||||
systemTime = System.nanoTime() / 1000000;
|
||||
if (placePriority.getValue()) {
|
||||
boolean wasPlacing = place.getValue();
|
||||
if (mc.gameSettings.keyBindUseItem.isKeyDown() && place.getValue()) {
|
||||
place.setValue(false);
|
||||
explode(crystal);
|
||||
}
|
||||
if (!place.getValue() && wasPlacing) place.setValue(true);
|
||||
}
|
||||
if (explodeBehavior.getValue() == ExplodeBehavior.ALWAYS) {
|
||||
explode(crystal);
|
||||
}
|
||||
for (Vec3d vecOffset:holeOffset) { /* for placeholder offset for each BlockPos in the list holeOffset */
|
||||
BlockPos offset = new BlockPos(vecOffset.x, vecOffset.y, vecOffset.z);
|
||||
if (mc.world.getBlockState(offset).getBlock() == Blocks.OBSIDIAN || mc.world.getBlockState(offset).getBlock() == Blocks.BEDROCK) {
|
||||
holeBlocks++;
|
||||
}
|
||||
}
|
||||
if (explodeBehavior.getValue() == ExplodeBehavior.HOLE_ONLY) {
|
||||
if (holeBlocks == 5) {
|
||||
explode(crystal);
|
||||
}
|
||||
}
|
||||
if (explodeBehavior.getValue() == ExplodeBehavior.PREVENT_SUICIDE) {
|
||||
if (mc.player.getPositionVector().distanceTo(crystal.getPositionVector()) <= 0.5 && mc.player.getPosition().getY() == crystal.getPosition().getY()|| mc.player.getPositionVector().distanceTo(crystal.getPositionVector()) >= 2.3 && mc.player.getPosition().getY() == crystal.getPosition().getY()||mc.player.getPositionVector().distanceTo(crystal.getPositionVector()) >= 0.5 && mc.player.getPosition().getY() != crystal.getPosition().getY()) {
|
||||
explode(crystal);
|
||||
}
|
||||
}
|
||||
if (explodeBehavior.getValue() == ExplodeBehavior.LEFT_CLICK_ONLY && mc.gameSettings.keyBindAttack.isKeyDown()) {
|
||||
explode(crystal);
|
||||
}
|
||||
if (sneakEnable.getValue() && mc.player.isSneaking() && holeBlocks != 5) {
|
||||
ModuleManager.getModuleByName("Surround").enable();
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
} else {
|
||||
resetRotation();
|
||||
if (oldSlot != -1) {
|
||||
|
@ -164,8 +262,8 @@ public class CrystalAura extends Module {
|
|||
BlockPos q = null;
|
||||
double damage = .5;
|
||||
for (Entity entity : entities) {
|
||||
// stop if the entities health is 0 or less then 0 (somehow) or if the entity is you
|
||||
if (entity == mc.player || ((EntityLivingBase) entity).getHealth() <= 0) {
|
||||
// stop if the entities health is 0 or less then 0 (somehow) or if the entity is you, don't do excess calculation if multiplace is enabled
|
||||
if (entity == mc.player || ((EntityLivingBase) entity).getHealth() <= 0 || placeBehavior.getValue() == PlaceBehavior.MULTI) {
|
||||
continue;
|
||||
}
|
||||
for (BlockPos blockPos : blocks) {
|
||||
|
@ -194,15 +292,38 @@ public class CrystalAura extends Module {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (place.getValue() && placeBehavior.getValue() == PlaceBehavior.MULTI) {
|
||||
for (Entity entity : entities) {
|
||||
|
||||
if (entity == mc.player || ((EntityLivingBase) entity).getHealth() <= 0) {
|
||||
continue;
|
||||
}
|
||||
for (BlockPos blockPos : blocks) {
|
||||
double b = entity.getDistanceSq(blockPos);
|
||||
if (b > 75) {
|
||||
continue;
|
||||
}
|
||||
double d = calculateDamage(blockPos.x + .5, blockPos.y + 1, blockPos.z + .5, entity);
|
||||
double self = calculateDamage(blockPos.x + .5, blockPos.y + 1, blockPos.z + .5, mc.player);
|
||||
if (self >= mc.player.getHealth()+mc.player.getAbsorptionAmount() || self > d) continue;
|
||||
if (b < 10 && d >= 15 || d >= ((EntityLivingBase) entity).getHealth() + ((EntityLivingBase) entity).getAbsorptionAmount() || 6 >= ((EntityLivingBase) entity).getHealth() + ((EntityLivingBase) entity).getAbsorptionAmount() && b < 4 || b < 9 && d >= minDmg.getValue() && minDmg.getValue() > 0.0) {
|
||||
q = blockPos;
|
||||
damage = d;
|
||||
renderEnt = entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (damage == .5) {
|
||||
render = null;
|
||||
renderEnt = null;
|
||||
resetRotation();
|
||||
return;
|
||||
}
|
||||
render = q;
|
||||
|
||||
// this sends a constant packet flow for default packets
|
||||
if (place.getValue()) {
|
||||
render = q;
|
||||
if (!offhand && mc.player.inventory.currentItem != crystalSlot) {
|
||||
if (autoSwitch.getValue()) {
|
||||
mc.player.inventory.currentItem = crystalSlot;
|
||||
|
@ -227,7 +348,6 @@ public class CrystalAura extends Module {
|
|||
//mc.playerController.processRightClickBlock(mc.player, mc.world, q, f, new Vec3d(0, 0, 0), EnumHand.MAIN_HAND);
|
||||
mc.player.connection.sendPacket(new CPacketPlayerTryUseItemOnBlock(q, f, offhand ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND, 0, 0, 0));
|
||||
}
|
||||
//this sends a constant packet flow for default packets
|
||||
if (isSpoofingAngles) {
|
||||
if (togglePitch) {
|
||||
mc.player.rotationPitch += 0.0004;
|
||||
|
@ -237,25 +357,36 @@ public class CrystalAura extends Module {
|
|||
togglePitch = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorldRender(RenderEvent event) {
|
||||
if (render != null) {
|
||||
KamiTessellator.prepare(GL11.GL_QUADS);
|
||||
KamiTessellator.drawBox(render, 0x44ffffff, GeometryMasks.Quad.ALL);
|
||||
int colour = 0x44ffffff;
|
||||
if (customColours.getValue()) colour = rgbToInt(r.getValue(), g.getValue(), b.getValue(), aBlock.getValue());
|
||||
KamiTessellator.drawBox(render, colour, GeometryMasks.Quad.ALL);
|
||||
KamiTessellator.release();
|
||||
if (renderEnt != null && tracer.getValue()) {
|
||||
Vec3d p = EntityUtil.getInterpolatedRenderPos(renderEnt, mc.getRenderPartialTicks());
|
||||
Tracers.drawLineFromPosToPos(render.x - mc.getRenderManager().renderPosX + .5d, render.y - mc.getRenderManager().renderPosY + 1, render.z - mc.getRenderManager().renderPosZ + .5d, p.x, p.y, p.z, renderEnt.getEyeHeight(), 1, 1, 1, 1);
|
||||
float rL = 1;
|
||||
float gL = 1;
|
||||
float bL = 1;
|
||||
float aL = 1;
|
||||
if (customColours.getValue()) {
|
||||
rL = toF(r.getValue());
|
||||
gL = toF(g.getValue());
|
||||
bL = toF(b.getValue());
|
||||
aL = toF(aTracer.getValue());
|
||||
}
|
||||
Tracers.drawLineFromPosToPos(render.x - mc.getRenderManager().renderPosX + .5d, render.y - mc.getRenderManager().renderPosY + 1, render.z - mc.getRenderManager().renderPosZ + .5d, p.x, p.y, p.z, renderEnt.getEyeHeight(), rL, gL, bL, aL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void lookAtPacket(double px, double py, double pz, EntityPlayer me) {
|
||||
double[] v = calculateLookAt(px, py, pz, me);
|
||||
setYawAndPitch((float) v[0], (float) v[1]);
|
||||
setYawAndPitch((float) v[0], (float) v[1]+1f);
|
||||
}
|
||||
|
||||
private boolean canPlaceCrystal(BlockPos blockPos) {
|
||||
|
@ -300,18 +431,18 @@ public class CrystalAura extends Module {
|
|||
|
||||
public static float calculateDamage(double posX, double posY, double posZ, Entity entity) {
|
||||
float doubleExplosionSize = 6.0F * 2.0F;
|
||||
double distancedsize = entity.getDistance(posX, posY, posZ) / (double) doubleExplosionSize;
|
||||
double distancedSize = entity.getDistance(posX, posY, posZ) / (double) doubleExplosionSize;
|
||||
Vec3d vec3d = new Vec3d(posX, posY, posZ);
|
||||
double blockDensity = (double) entity.world.getBlockDensity(vec3d, entity.getEntityBoundingBox());
|
||||
double v = (1.0D - distancedsize) * blockDensity;
|
||||
double blockDensity = entity.world.getBlockDensity(vec3d, entity.getEntityBoundingBox());
|
||||
double v = (1.0D - distancedSize) * blockDensity;
|
||||
float damage = (float) ((int) ((v * v + v) / 2.0D * 7.0D * (double) doubleExplosionSize + 1.0D));
|
||||
double finald = 1;
|
||||
double finalD = 1;
|
||||
/*if (entity instanceof EntityLivingBase)
|
||||
finald = getBlastReduction((EntityLivingBase) entity,getDamageMultiplied(damage));*/
|
||||
finalD = getBlastReduction((EntityLivingBase) entity,getDamageMultiplied(damage));*/
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
finald = getBlastReduction((EntityLivingBase) entity, getDamageMultiplied(damage), new Explosion(mc.world, null, posX, posY, posZ, 6F, false, true));
|
||||
finalD = getBlastReduction((EntityLivingBase) entity, getDamageMultiplied(damage), new Explosion(mc.world, null, posX, posY, posZ, 6F, false, true));
|
||||
}
|
||||
return (float) finald;
|
||||
return (float) finalD;
|
||||
}
|
||||
|
||||
public static float getBlastReduction(EntityLivingBase entity, float damage, Explosion explosion) {
|
||||
|
@ -324,7 +455,7 @@ public class CrystalAura extends Module {
|
|||
float f = MathHelper.clamp(k, 0.0F, 20.0F);
|
||||
damage = damage * (1.0F - f / 25.0F);
|
||||
|
||||
if (entity.isPotionActive(Potion.getPotionById(11))) {
|
||||
if (entity.isPotionActive(Objects.requireNonNull(Potion.getPotionById(11)))) {
|
||||
damage = damage - (damage / 4);
|
||||
}
|
||||
|
||||
|
@ -344,6 +475,7 @@ public class CrystalAura extends Module {
|
|||
return calculateDamage(crystal.posX, crystal.posY, crystal.posZ, entity);
|
||||
}
|
||||
|
||||
|
||||
//Better Rotation Spoofing System:
|
||||
|
||||
private static boolean isSpoofingAngles;
|
||||
|
@ -367,7 +499,7 @@ public class CrystalAura extends Module {
|
|||
|
||||
|
||||
@EventHandler
|
||||
private Listener<PacketEvent.Send> packetListener = new Listener<>(event -> {
|
||||
private Listener<PacketEvent.Send> cPacketListener = new Listener<>(event -> {
|
||||
Packet packet = event.getPacket();
|
||||
if (packet instanceof CPacketPlayer) {
|
||||
if (isSpoofingAngles) {
|
||||
|
@ -377,15 +509,87 @@ public class CrystalAura extends Module {
|
|||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onEnable() { sendMessage("&aENABLED&r"); }
|
||||
|
||||
public void onDisable() {
|
||||
sendMessage("&cDISABLED&r");
|
||||
render = null;
|
||||
renderEnt = null;
|
||||
resetRotation();
|
||||
}
|
||||
|
||||
public void explode(EntityEnderCrystal crystal) {
|
||||
if (crystal == null) return;
|
||||
|
||||
if (lastCrystal == crystal) hitTries++;
|
||||
else {
|
||||
lastCrystal = crystal;
|
||||
hitTries = 0;
|
||||
}
|
||||
|
||||
try {
|
||||
if (hitAttempts.getValue() != -1 && hitTries > hitAttempts.getValue()) {
|
||||
ignoredCrystals.add(crystal);
|
||||
hitTries = 0;
|
||||
} else {
|
||||
lookAtPacket(crystal.posX, crystal.posY, crystal.posZ, mc.player);
|
||||
mc.playerController.attackEntity(mc.player, crystal);
|
||||
mc.player.swingArm(EnumHand.MAIN_HAND);
|
||||
}
|
||||
} catch (Throwable ignored) { }
|
||||
|
||||
systemTime = System.nanoTime() / 1000000L;
|
||||
}
|
||||
|
||||
private boolean passSwordCheck() {
|
||||
if (!noToolExplode.getValue() || antiWeakness.getValue()) return true;
|
||||
else return !noToolExplode.getValue() || (!(mc.player.getHeldItemMainhand().getItem() instanceof ItemTool) && !(mc.player.getHeldItemMainhand().getItem() instanceof ItemSword));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHudInfo() {
|
||||
return String.valueOf(getItems(Items.END_CRYSTAL));
|
||||
}
|
||||
|
||||
private boolean ignored(Entity e) {
|
||||
if (ignoredCrystals == null) return false;
|
||||
for (EntityEnderCrystal c : ignoredCrystals) if (e != null && e == c) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void resetHitAttempts() {
|
||||
sendMessage("&l&9Reset&r&9 hit attempts crystals");
|
||||
lastCrystal = null;
|
||||
ignoredCrystals = null;
|
||||
hitTries = 0;
|
||||
}
|
||||
|
||||
private void resetHitAttempts(boolean should) {
|
||||
if (should) {
|
||||
lastCrystal = null;
|
||||
ignoredCrystals = null;
|
||||
hitTries = 0;
|
||||
} else if (resetTime()) {
|
||||
sendMessage("&l&9Reset&r&9 hit attempts crystals");
|
||||
lastCrystal = null;
|
||||
ignoredCrystals = null;
|
||||
hitTries = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static long startTime = 0;
|
||||
private boolean resetTime() {
|
||||
if (startTime == 0) startTime = System.currentTimeMillis();
|
||||
if (startTime + 900000 <= System.currentTimeMillis()) { // 15 minutes in milliseconds
|
||||
startTime = System.currentTimeMillis();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void sendMessage(String message) {
|
||||
if (statusMessages.getValue()) {
|
||||
Command.sendChatMessage(getChatName() + message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import me.zeroeightsix.kami.module.Module;
|
|||
import me.zeroeightsix.kami.module.ModuleManager;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import net.minecraft.entity.item.EntityEnderCrystal;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ClickType;
|
||||
import net.minecraft.item.*;
|
||||
|
@ -15,6 +16,9 @@ import net.minecraft.network.play.client.CPacketPlayerTryUseItem;
|
|||
|
||||
import static me.zeroeightsix.kami.module.modules.gui.InfoOverlay.getItems;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author polymer (main listener switch function xd)
|
||||
* @author S-B99 (made epic and smooth and cleaned up code <3) (why did i rewrite this 4 times)
|
||||
|
@ -27,6 +31,7 @@ public class OffhandGap extends Module {
|
|||
private Setting<Boolean> eatWhileAttacking = register(Settings.b("Eat While Attacking", false));
|
||||
private Setting<Boolean> swordOrAxeOnly = register(Settings.b("Sword or Axe Only", true));
|
||||
private Setting<Boolean> preferBlocks = register(Settings.booleanBuilder("Prefer Placing Blocks").withValue(false).withVisibility(v -> !swordOrAxeOnly.getValue()).build());
|
||||
private Setting<Boolean> crystalCheck = register(Settings.b("Crystal Check", false));
|
||||
// private Setting<Mode> modeSetting = register(Settings.e("Use Mode", Mode.GAPPLE));
|
||||
|
||||
// private enum Mode {
|
||||
|
@ -38,6 +43,7 @@ public class OffhandGap extends Module {
|
|||
boolean cancelled = false;
|
||||
Item usedItem;
|
||||
Item toUseItem;
|
||||
CrystalAura crystalAura;
|
||||
|
||||
@EventHandler
|
||||
private Listener<PacketEvent.Send> sendListener = new Listener<>(e ->{
|
||||
|
@ -47,9 +53,9 @@ public class OffhandGap extends Module {
|
|||
return;
|
||||
}
|
||||
if (mc.player.getHeldItemMainhand().getItem() instanceof ItemSword || mc.player.getHeldItemMainhand().getItem() instanceof ItemAxe || passItemCheck()) {
|
||||
if (ModuleManager.isModuleEnabled("AutoTotem")) {
|
||||
if (ModuleManager.isModuleEnabled("AutoOffhand")) {
|
||||
autoTotemWasEnabled = true;
|
||||
ModuleManager.getModuleByName("AutoTotem").disable();
|
||||
ModuleManager.getModuleByName("AutoOffhand").disable();
|
||||
}
|
||||
if (!eatWhileAttacking.getValue()) { /* Save item for later when using preventDesync */
|
||||
usedItem = mc.player.getHeldItemMainhand().getItem();
|
||||
|
@ -71,6 +77,17 @@ public class OffhandGap extends Module {
|
|||
else if (mc.player.getHealth() + mc.player.getAbsorptionAmount() <= disableHealth.getValue()) {
|
||||
disableGaps();
|
||||
}
|
||||
/* Disable if there are crystals in the range of CrystalAura */
|
||||
else if (crystalCheck.getValue() && crystalAura.isEnabled()) {
|
||||
EntityEnderCrystal crystal = mc.world.loadedEntityList.stream()
|
||||
.filter(entity -> entity instanceof EntityEnderCrystal)
|
||||
.map(entity -> (EntityEnderCrystal) entity)
|
||||
.min(Comparator.comparing(c -> mc.player.getDistance(c)))
|
||||
.orElse(null);
|
||||
if (Objects.requireNonNull(crystal).getPosition().distanceSq(mc.player.getPosition().x, mc.player.getPosition().y, mc.player.getPosition().z) <= crystalAura.range.getValue()) {
|
||||
disableGaps();
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException ignored) { }
|
||||
});
|
||||
|
||||
|
@ -118,9 +135,9 @@ public class OffhandGap extends Module {
|
|||
}
|
||||
|
||||
private void disableGaps() {
|
||||
if (autoTotemWasEnabled != ModuleManager.isModuleEnabled("AutoTotem")) {
|
||||
if (autoTotemWasEnabled != ModuleManager.isModuleEnabled("AutoOffhand")) {
|
||||
moveGapsToInventory(gaps);
|
||||
ModuleManager.getModuleByName("AutoTotem").enable();
|
||||
ModuleManager.getModuleByName("AutoOffhand").enable();
|
||||
autoTotemWasEnabled = false;
|
||||
}
|
||||
}
|
||||
|
@ -143,4 +160,6 @@ public class OffhandGap extends Module {
|
|||
public String getHudInfo() {
|
||||
return String.valueOf(getItems(Items.GOLDEN_APPLE));
|
||||
}
|
||||
|
||||
public void onEnable() { crystalAura = (CrystalAura) ModuleManager.getModuleByName("CrystalAura"); }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,184 @@
|
|||
package me.zeroeightsix.kami.module.modules.combat;
|
||||
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.KamiMod;
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.event.events.EntityUseTotemEvent;
|
||||
import me.zeroeightsix.kami.event.events.PacketEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import me.zeroeightsix.kami.util.ColourTextFormatting;
|
||||
import me.zeroeightsix.kami.util.Friends;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.network.play.server.SPacketEntityStatus;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static me.zeroeightsix.kami.KamiMod.EVENT_BUS;
|
||||
import static me.zeroeightsix.kami.util.ColourTextFormatting.toTextMap;
|
||||
|
||||
/**
|
||||
* @author S-B99
|
||||
* Created by S-B99 on 25/03/20
|
||||
* Listener and stuff reused from CliNet
|
||||
* https://github.com/DarkiBoi/CliNet/blob/fd225a5c8cc373974b0c9a3457acbeed206e8cca/src/main/java/me/zeroeightsix/kami/module/modules/combat/TotemPopCounter.java
|
||||
*/
|
||||
@Module.Info(name = "TotemPopCounter", description = "Counts how many times players pop", category = Module.Category.COMBAT)
|
||||
public class TotemPopCounter extends Module {
|
||||
private Setting<Boolean> countFriends = register(Settings.b("Count Friends", true));
|
||||
private Setting<Boolean> countSelf = register(Settings.b("Count Self", false));
|
||||
private Setting<Boolean> resetDeaths = register(Settings.b("Reset On Death", true));
|
||||
private Setting<Boolean> resetSelfDeaths = register(Settings.b("Reset Self Death", true));
|
||||
private Setting<Announce> announceSetting = register(Settings.e("Announce", Announce.CLIENT));
|
||||
private Setting<Boolean> thanksTo = register(Settings.b("Thanks to", false));
|
||||
private Setting<ColourTextFormatting.ColourCode> colourCode = register(Settings.e("Color Name", ColourTextFormatting.ColourCode.DARK_PURPLE));
|
||||
private Setting<ColourTextFormatting.ColourCode> colourCode1 = register(Settings.e("Color Number", ColourTextFormatting.ColourCode.LIGHT_PURPLE));
|
||||
|
||||
private enum Announce { CLIENT, EVERYONE }
|
||||
private HashMap<String, Integer> playerList = new HashMap();
|
||||
private boolean isDead = false;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (!isDead
|
||||
&& resetSelfDeaths.getValue()
|
||||
&& 0 >= mc.player.getHealth()) {
|
||||
sendMessage(formatName(mc.player.getName()) + " died and " + grammar(mc.player.getName()) + " pop list was reset!");
|
||||
isDead = true;
|
||||
playerList.clear();
|
||||
return;
|
||||
}
|
||||
if (isDead && 0 < mc.player.getHealth()) isDead = false;
|
||||
|
||||
for (EntityPlayer player : mc.world.playerEntities) {
|
||||
if (
|
||||
resetDeaths.getValue()
|
||||
&& 0 >= player.getHealth()
|
||||
&& friendCheck(player.getName())
|
||||
&& selfCheck(player.getName())
|
||||
&& playerList.containsKey(player.getName())) {
|
||||
/* To note: if they died after popping 1 totem it's going to say totems, but I cba to fix it */
|
||||
sendMessage(formatName(player.getName()) + " died after popping " + formatNumber(playerList.get(player.getName())) + " totems" + ending());
|
||||
playerList.remove(player.getName(), playerList.get(player.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public Listener<EntityUseTotemEvent> listListener = new Listener<>(event -> {
|
||||
if (playerList == null) playerList = new HashMap<>();
|
||||
|
||||
if (playerList.get(event.getEntity().getName()) == null) {
|
||||
playerList.put(event.getEntity().getName(), 1);
|
||||
sendMessage(formatName(event.getEntity().getName()) + " popped " + formatNumber(1) + " totem" + ending());
|
||||
}
|
||||
|
||||
else if (!(playerList.get(event.getEntity().getName()) == null)) {
|
||||
int popCounter = playerList.get(event.getEntity().getName());
|
||||
popCounter += 1;
|
||||
playerList.put(event.getEntity().getName(), popCounter);
|
||||
sendMessage(formatName(event.getEntity().getName()) + " popped " + formatNumber(popCounter) + " totems" + ending());
|
||||
}
|
||||
});
|
||||
|
||||
private boolean friendCheck(String name) {
|
||||
if (isDead) return false;
|
||||
for (Friends.Friend names : Friends.friends.getValue()) {
|
||||
if (names.getUsername().equalsIgnoreCase(name)) return countFriends.getValue();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean selfCheck(String name) {
|
||||
if (isDead) return false;
|
||||
if (countSelf.getValue() && name.equalsIgnoreCase(mc.player.getName())) {
|
||||
return true;
|
||||
}
|
||||
else if (!countSelf.getValue() && name.equalsIgnoreCase(mc.player.getName())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isSelf(String name) {
|
||||
return name.equalsIgnoreCase(mc.player.getName());
|
||||
}
|
||||
|
||||
private boolean isFriend(String name) {
|
||||
for (Friends.Friend names : Friends.friends.getValue()) {
|
||||
if (names.getUsername().equalsIgnoreCase(name)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String formatName(String name) {
|
||||
String extraText = "";
|
||||
if (isFriend(name) && !isPublic()) extraText = "Your friend, ";
|
||||
else if (isFriend(name) && isPublic()) extraText = "My friend, ";
|
||||
if (isSelf(name)) { extraText = ""; name = "I"; }
|
||||
|
||||
if (announceSetting.getValue().equals(Announce.EVERYONE)) {
|
||||
return extraText + name;
|
||||
}
|
||||
return extraText + setToText(colourCode.getValue()) + name + TextFormatting.RESET;
|
||||
}
|
||||
|
||||
private String grammar(String name) {
|
||||
if (isSelf(name)) {
|
||||
return "my";
|
||||
}
|
||||
else return "their";
|
||||
}
|
||||
|
||||
private String ending() {
|
||||
if (thanksTo.getValue()) {
|
||||
return " thanks to " + KamiMod.MODNAME + "!";
|
||||
}
|
||||
else return "!";
|
||||
}
|
||||
|
||||
private boolean isPublic() {
|
||||
return announceSetting.getValue().equals(Announce.EVERYONE);
|
||||
}
|
||||
|
||||
private String formatNumber(int message) {
|
||||
if (announceSetting.getValue().equals(Announce.EVERYONE)) return "" + message;
|
||||
return setToText(colourCode1.getValue()) + "" + message + TextFormatting.RESET;
|
||||
}
|
||||
|
||||
private void sendMessage(String message) {
|
||||
switch (announceSetting.getValue()) {
|
||||
case CLIENT:
|
||||
Command.sendRawChatMessage(message);
|
||||
return;
|
||||
case EVERYONE:
|
||||
Command.sendServerMessage(message);
|
||||
return;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public Listener<PacketEvent.Receive> popListener = new Listener<>(event -> {
|
||||
if (mc.player == null) return;
|
||||
|
||||
if (event.getPacket() instanceof SPacketEntityStatus) {
|
||||
SPacketEntityStatus packet = (SPacketEntityStatus) event.getPacket();
|
||||
if (packet.getOpCode() == 35) {
|
||||
Entity entity = packet.getEntity(mc.world);
|
||||
if (friendCheck(entity.getName()) || selfCheck(entity.getName())) {
|
||||
EVENT_BUS.post(new EntityUseTotemEvent(entity));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
private TextFormatting setToText(ColourTextFormatting.ColourCode colourCode) {
|
||||
return toTextMap.get(colourCode);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,199 @@
|
|||
package me.zeroeightsix.kami.module.modules.experimental;
|
||||
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.event.events.PacketEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.module.ModuleManager;
|
||||
import me.zeroeightsix.kami.module.modules.combat.CrystalAura;
|
||||
import me.zeroeightsix.kami.module.modules.player.NoBreakAnimation;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import me.zeroeightsix.kami.util.BlockInteractionHelper;
|
||||
import me.zeroeightsix.kami.util.Friends;
|
||||
import me.zeroeightsix.kami.util.Wrapper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockObsidian;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.client.CPacketHeldItemChange;
|
||||
import net.minecraft.network.play.client.CPacketPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static me.zeroeightsix.kami.module.modules.combat.CrystalAura.getPlayerPos;
|
||||
import static me.zeroeightsix.kami.util.EntityUtil.calculateLookAt;
|
||||
|
||||
/**
|
||||
* @author hub
|
||||
* @author polymer
|
||||
* Created by polymer on 12/03/20
|
||||
*/
|
||||
|
||||
@Module.Info(name = "HoleFiller", category = Module.Category.EXPERIMENTAL, description="Fills holes around the player to make people easier to crystal.")
|
||||
public class HoleFiller extends Module {
|
||||
private Setting<Double> distance = register(Settings.d("Range", 4.0));
|
||||
private Setting<Boolean> render = register(Settings.b("Render Filled Blocks", false));
|
||||
private Setting<Boolean> holeCheck = register(Settings.b("Only Fill in Hole", true));
|
||||
private Setting<Boolean> ignoreWalls = register(Settings.b("Ignore Walls", false));
|
||||
|
||||
public List<BlockPos> blockPosList;
|
||||
List<Entity> entities = new ArrayList<>();
|
||||
|
||||
public boolean isHole;
|
||||
static boolean isSpoofingAngles;
|
||||
static float yaw;
|
||||
static float pitch;
|
||||
|
||||
private final BlockPos[] surroundOffset = {
|
||||
new BlockPos(0, -1, 0), // down
|
||||
new BlockPos(0, 0, -1), // north
|
||||
new BlockPos(1, 0, 0), // east
|
||||
new BlockPos(0, 0, 1), // south
|
||||
new BlockPos(-1, 0, 0) // west
|
||||
};
|
||||
|
||||
private int findObiInHotbar() {
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
ItemStack stack = Wrapper.getPlayer().inventory.getStackInSlot(i);
|
||||
if (stack != ItemStack.EMPTY && stack.getItem() instanceof ItemBlock) {
|
||||
Block block = ((ItemBlock) stack.getItem()).getBlock();
|
||||
if (block instanceof BlockObsidian) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
/* mc.player can only be null if the world is null, so checking if the mc.player is null *should be sufficient */
|
||||
if (mc.player == null || mc.world == null) return;
|
||||
|
||||
Vec3d[] holeOffset = {
|
||||
mc.player.getPositionVector().add(1, 0, 0),
|
||||
mc.player.getPositionVector().add(-1, 0, 0),
|
||||
mc.player.getPositionVector().add(0, 0, 1),
|
||||
mc.player.getPositionVector().add(0, 0, -1),
|
||||
mc.player.getPositionVector().add(0, -1, 0)
|
||||
};
|
||||
|
||||
|
||||
entities.addAll(mc.world.playerEntities.stream().filter(entityPlayer -> !Friends.isFriend(entityPlayer.getName())).collect(Collectors.toList()));
|
||||
int range = (int) Math.ceil(distance.getValue());
|
||||
CrystalAura ca = (CrystalAura) ModuleManager.getModuleByName("CrystalAura");
|
||||
blockPosList = ca.getSphere(getPlayerPos(), range, range, false, true, 0);
|
||||
for (Entity p : entities) {
|
||||
List<BlockPos> maybe = ca.getSphere(p.getPosition(), range, range, false, true, 0);
|
||||
for (BlockPos pos : maybe) {
|
||||
if (ignoreWalls.getValue()) {
|
||||
blockPosList.add(pos);
|
||||
} else if (mc.world.rayTraceBlocks(new Vec3d(mc.player.getPosition().x, mc.player.getPosition().y + p.getEyeHeight(), mc.player.getPosition().z), new Vec3d(pos.x, pos.y + (double)p.getEyeHeight(), pos.z), false, true, false) != null) {
|
||||
blockPosList.add(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (blockPosList == null) return;
|
||||
for (BlockPos p: blockPosList) {
|
||||
if (p == null) return;
|
||||
|
||||
isHole = true;
|
||||
// block gotta be air
|
||||
if (!mc.world.getBlockState(p).getBlock().equals(Blocks.AIR)) continue;
|
||||
|
||||
// block 1 above gotta be air
|
||||
if (!mc.world.getBlockState(p.add(0, 1, 0)).getBlock().equals(Blocks.AIR)) continue;
|
||||
|
||||
// block 2 above gotta be air
|
||||
if (!mc.world.getBlockState(p.add(0, 2, 0)).getBlock().equals(Blocks.AIR)) continue;
|
||||
|
||||
for (BlockPos o : surroundOffset) {
|
||||
Block block = mc.world.getBlockState(p.add(o)).getBlock();
|
||||
if (block != Blocks.BEDROCK && block != Blocks.OBSIDIAN && block != Blocks.ENDER_CHEST && block != Blocks.ANVIL) {
|
||||
isHole = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int h = 0;
|
||||
if (holeCheck.getValue()) {
|
||||
for (Vec3d o: holeOffset) {
|
||||
BlockPos q = new BlockPos (o.x, o.y, o.z);
|
||||
Block b = mc.world.getBlockState(q).getBlock();
|
||||
if (b == Blocks.OBSIDIAN || b == Blocks.BEDROCK) {
|
||||
h++;
|
||||
}
|
||||
}
|
||||
if (h != 5) return;
|
||||
}
|
||||
|
||||
if (isHole) {
|
||||
if (mc.player.getPositionVector().squareDistanceTo(p.x, p.y, p.z) <= 1.2) {
|
||||
return;
|
||||
}
|
||||
for (Entity e : entities) {
|
||||
if (e.getPositionVector().squareDistanceTo(p.x, p.y, p.z) <= 1.2) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
int oldSlot = mc.player.inventory.currentItem;
|
||||
int obiSlot = -1;
|
||||
obiSlot = findObiInHotbar();
|
||||
if (obiSlot == -1) {
|
||||
Command.sendChatMessage("&cError: &rNo obsidian in hotbar! disabling.");
|
||||
this.disable();
|
||||
}
|
||||
mc.player.connection.sendPacket(new CPacketHeldItemChange(obiSlot));
|
||||
lookAtPacket(p.x, p.y, p.z, mc.player);
|
||||
BlockInteractionHelper.placeBlockScaffold(p);
|
||||
if (ModuleManager.getModuleByName("NoBreakAnimation").isEnabled()) {
|
||||
((NoBreakAnimation) ModuleManager.getModuleByName("NoBreakAnimation")).resetMining();
|
||||
}
|
||||
resetRotation();
|
||||
mc.player.connection.sendPacket(new CPacketHeldItemChange(oldSlot));
|
||||
}
|
||||
}
|
||||
}
|
||||
private void lookAtPacket(double px, double py, double pz, EntityPlayer me) {
|
||||
double[] v = calculateLookAt(px, py, pz, me);
|
||||
setYawAndPitch((float) v[0], (float) v[1]+1f);
|
||||
}
|
||||
private static void setYawAndPitch(float yaw1, float pitch1) {
|
||||
yaw = yaw1;
|
||||
pitch = pitch1;
|
||||
isSpoofingAngles = true;
|
||||
}
|
||||
|
||||
private static void resetRotation() {
|
||||
if (isSpoofingAngles) {
|
||||
yaw = mc.player.rotationYaw;
|
||||
pitch = mc.player.rotationPitch;
|
||||
isSpoofingAngles = false;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private Listener<PacketEvent.Send> cPacketListener = new Listener<>(event -> {
|
||||
Packet packet = event.getPacket();
|
||||
if (packet instanceof CPacketPlayer) {
|
||||
if (isSpoofingAngles) {
|
||||
((CPacketPlayer) packet).yaw = (float) yaw;
|
||||
((CPacketPlayer) packet).pitch = (float) pitch;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
|
@ -15,6 +15,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.util.math.Vec3d;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static me.zeroeightsix.kami.util.ColourConverter.rgbToInt;
|
||||
|
||||
/**
|
||||
* Created by 086 on 11/12/2017.
|
||||
* <p>
|
||||
|
@ -28,8 +30,12 @@ public class Tracers extends Module {
|
|||
private Setting<Boolean> animals = register(Settings.b("Animals", false));
|
||||
private Setting<Boolean> mobs = register(Settings.b("Mobs", false));
|
||||
private Setting<Double> range = register(Settings.d("Range", 200));
|
||||
private Setting<Float> opacity = register(Settings.floatBuilder("Opacity").withRange(0f, 1f).withValue(1f));
|
||||
private Setting<Boolean> renderInvis = register(Settings.b("Invisible", false));
|
||||
private Setting<Boolean> customColours = register(Settings.booleanBuilder("Custom Colours").withValue(true).build());
|
||||
private Setting<Float> opacity = register(Settings.floatBuilder("Opacity").withRange(0f, 1f).withValue(1f).build());
|
||||
private Setting<Integer> r = register(Settings.integerBuilder("Red").withMinimum(0).withValue(155).withMaximum(255).withVisibility(v -> customColours.getValue()).build());
|
||||
private Setting<Integer> g = register(Settings.integerBuilder("Green").withMinimum(0).withValue(144).withMaximum(255).withVisibility(v -> customColours.getValue()).build());
|
||||
private Setting<Integer> b = register(Settings.integerBuilder("Blue").withMinimum(0).withValue(255).withMaximum(255).withVisibility(v -> customColours.getValue()).build());
|
||||
|
||||
HueCycler cycler = new HueCycler(3600);
|
||||
|
||||
|
@ -51,6 +57,12 @@ public class Tracers extends Module {
|
|||
int colour = getColour(entity);
|
||||
if (colour == ColourUtils.Colors.RAINBOW) {
|
||||
if (!friends.getValue()) return;
|
||||
if (customColours.getValue()) {
|
||||
colour = rgbToInt(r.getValue(), g.getValue(), b.getValue(), (int) (opacity.getValue() * 255f));
|
||||
} else {
|
||||
colour = cycler.current();
|
||||
}
|
||||
} else {
|
||||
colour = cycler.current();
|
||||
}
|
||||
final float r = ((colour >>> 16) & 0xFF) / 255f;
|
||||
|
|
Loading…
Reference in New Issue