Skip to content

Commit

Permalink
1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipPanda committed May 2, 2024
1 parent d511aac commit b98b236
Show file tree
Hide file tree
Showing 44 changed files with 1,720 additions and 427 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod_id=templeclient
mod_name=TempleClient
mod_group=xyz.templecheats.templeclient
mod_version=1.9.0
mod_version=1.9.1
mod_author=["PhilipPanda"]
mod_description=a 1.12.2 Minecraft utility mod
minecraft_version=1.12.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class TempleClient {
public static final String MODID = "templeclient";
public static final String NAME = "Temple Client";
public static final String VERSION = "1.9.0";
public static final String VERSION = "1.9.1";
public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
public static String name = NAME + " " + VERSION;
public static AnnotatedEventManager eventBus;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package xyz.templecheats.templeclient.event.events.player;

import net.minecraftforge.fml.common.eventhandler.Event;

public class JumpEvent extends Event {
public final double motionX;
public final double motionZ;

public JumpEvent(double motionX, double motionZ) {
this.motionX = motionX;
this.motionZ = motionZ;
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package xyz.templecheats.templeclient.features.gui.menu.alt;

import com.mojang.authlib.Agent;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Session;
import org.lwjgl.input.Keyboard;
import xyz.templecheats.templeclient.TempleClient;

import java.awt.*;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.Proxy;
Expand All @@ -27,11 +31,11 @@ public class AltManager extends GuiScreen {
public void initGui() {
this.buttonList.clear();
int centerX = this.width / 2;
int centerY = this.height / 4;
this.inputField = new GuiTextField(10, this.fontRenderer, centerX - 100, 25, 200, 20);
this.addButton = new GuiButton(0, centerX - 100, 50, 98, 20, "Add Account");
this.deleteButton = new GuiButton(1, centerX + 2, 50, 98, 20, "Delete Account");
this.loginButton = new GuiButton(2, centerX - 49, 75, 98, 20, "Login");
int centerY = this.height - 50;
this.inputField = new GuiTextField(10, this.fontRenderer, centerX - 100, centerY - 25, 200, 20);
this.addButton = new GuiButton(0, centerX - 100, centerY, 98, 20, "Add Account");
this.deleteButton = new GuiButton(1, centerX + 2, centerY, 98, 20, "Delete Account");
this.loginButton = new GuiButton(2, centerX - 49, centerY + 25, 98, 20, "Login");
this.buttonList.add(this.addButton);
this.buttonList.add(this.deleteButton);
this.buttonList.add(this.loginButton);
Expand Down Expand Up @@ -85,11 +89,15 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
int startY = 100;
for (int i = 0; i < alts.size(); i++) {
int posY = startY + (i * 20);
drawRect(this.width / 2 - 100, posY - 10, this.width / 2 + 100, posY + 10, Color.BLACK.getRGB());
if (i == selectedAltIndex) {
drawCenteredString(fontRenderer, alts.get(i) + " [Selected]", this.width / 2, posY, 0xFFFF00);
} else {
drawCenteredString(fontRenderer, alts.get(i), this.width / 2, posY, 0xFFFFFF);
}
ResourceLocation skinTexture = new ResourceLocation("textures/entity/steve.png");
mc.getTextureManager().bindTexture(skinTexture);
Gui.drawScaledCustomSizeModalRect(this.width / 2 - 110, posY - 10, 8.0F, 8.0F, 8, 8, 20, 20, 64.0F, 64.0F);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import xyz.templecheats.templeclient.features.module.Module;
import xyz.templecheats.templeclient.util.render.shader.impl.GradientShader;
import xyz.templecheats.templeclient.util.render.RenderUtil;
import xyz.templecheats.templeclient.util.rotation.RotationUtil;
import xyz.templecheats.templeclient.util.setting.impl.BooleanSetting;
import xyz.templecheats.templeclient.util.setting.impl.DoubleSetting;
import xyz.templecheats.templeclient.util.setting.impl.IntSetting;
Expand All @@ -36,7 +35,7 @@ public class AutoTrap extends Module {
* Settings
*/
private final IntSetting blocksPerTick = new IntSetting("Blocks Per Tick", this, 1, 10, 1);
private final BooleanSetting disable = new BooleanSetting("Disable", this, true);
private final BooleanSetting autoDisable = new BooleanSetting("Auto Disable", this, true);
private final IntSetting range = new IntSetting("Range", this, 1, 6, 4);
private final BooleanSetting render = new BooleanSetting("Render", this, true);
private final BooleanSetting fill = new BooleanSetting("Box Fill", this, true);
Expand All @@ -61,7 +60,7 @@ public class AutoTrap extends Module {

public AutoTrap() {
super("AutoTrap", "Automatically traps enemies with obsidian", Keyboard.KEY_NONE, Category.Combat);
registerSettings(disable, blocksPerTick, range, render, fill, outline, opacity);
registerSettings(autoDisable, blocksPerTick, range, render, fill, outline, opacity);
}

@Override
Expand All @@ -87,7 +86,7 @@ public void onTick(TickEvent.ClientTickEvent event) {
if (Minecraft.getMinecraft().player == null || Minecraft.getMinecraft().world == null)
return;

if (finished && disable.booleanValue())
if (finished && autoDisable.booleanValue())
disable();

int blocksPlaced = 0;
Expand Down Expand Up @@ -160,17 +159,28 @@ private static int getSlot(Block block) {
return -1;
}

private static void placeBlock(BlockPos pos) {
public static void placeBlock(BlockPos pos) {
for (EnumFacing enumFacing : EnumFacing.values()) {
if (!Minecraft.getMinecraft().world.getBlockState(pos.offset(enumFacing)).getBlock().equals(Blocks.AIR) &&
!isIntercepted(pos)) {
if (!Minecraft.getMinecraft().world.getBlockState(pos.offset(enumFacing)).getBlock().equals(Blocks.AIR)
&& !isIntercepted(pos)) {
Vec3d vec = new Vec3d(pos.getX() + 0.5D + (double) enumFacing.getXOffset() * 0.5D,
pos.getY() + 0.5D + (double) enumFacing.getYOffset() * 0.5D,
pos.getZ() + 0.5D + (double) enumFacing.getZOffset() * 0.5D);
float[] rotations = RotationUtil.rotations(pos);

float[] old = new float[]{Minecraft.getMinecraft().player.rotationYaw,
Minecraft.getMinecraft().player.rotationPitch};

Minecraft.getMinecraft().player.connection.sendPacket(new CPacketPlayer.Rotation(
rotations[0], rotations[1], Minecraft.getMinecraft().player.onGround));
(float) Math.toDegrees(Math.atan2((vec.z - Minecraft.getMinecraft().player.posZ),
(vec.x - Minecraft.getMinecraft().player.posX))) - 90.0F,
(float) (-Math.toDegrees(Math.atan2(
(vec.y - (Minecraft.getMinecraft().player.posY
+ (double) Minecraft.getMinecraft().player.getEyeHeight())),
(Math.sqrt((vec.x - Minecraft.getMinecraft().player.posX)
* (vec.x - Minecraft.getMinecraft().player.posX)
+ (vec.z - Minecraft.getMinecraft().player.posZ)
* (vec.z - Minecraft.getMinecraft().player.posZ)))))),
Minecraft.getMinecraft().player.onGround));
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketEntityAction(
Minecraft.getMinecraft().player, CPacketEntityAction.Action.START_SNEAKING));
Minecraft.getMinecraft().playerController.processRightClickBlock(Minecraft.getMinecraft().player,
Expand All @@ -179,8 +189,8 @@ private static void placeBlock(BlockPos pos) {
Minecraft.getMinecraft().player.swingArm(EnumHand.MAIN_HAND);
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketEntityAction(
Minecraft.getMinecraft().player, CPacketEntityAction.Action.STOP_SNEAKING));
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketPlayer.Rotation(
rotations[0], rotations[1], Minecraft.getMinecraft().player.onGround));
Minecraft.getMinecraft().player.connection.sendPacket(
new CPacketPlayer.Rotation(old[0], old[1], Minecraft.getMinecraft().player.onGround));

return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,100 +1,144 @@
package xyz.templecheats.templeclient.features.module.modules.combat;

import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ClickType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.client.CPacketPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.lwjgl.input.Keyboard;
import xyz.templecheats.templeclient.features.module.Module;
import xyz.templecheats.templeclient.manager.ModuleManager;
import xyz.templecheats.templeclient.util.setting.impl.DoubleSetting;
import xyz.templecheats.templeclient.util.setting.impl.BooleanSetting;
import xyz.templecheats.templeclient.util.setting.impl.EnumSetting;
import xyz.templecheats.templeclient.util.setting.impl.IntSetting;

import java.util.Arrays;
import java.util.Map;

public class Offhand extends Module {
public class Offhand extends Module {
/*
* Settings
*/
private final DoubleSetting health = new DoubleSetting("Health", this, 0.0d, 36.0d, 14.0d);
private final DoubleSetting defaultHealthVal = new DoubleSetting("DHV", this, 0.0f, 36.0f, 14.0f);
private final EnumSetting < Item > item = new EnumSetting < > ("Item", this, Item.Crystal);
private final IntSetting totemHp = new IntSetting("Totem HP", this, 0, 36, 16);
private final BooleanSetting gappleInHole = new BooleanSetting("Gap In Hole", this, false);
private final IntSetting gappleInHoleHP = new IntSetting("Gap Hole HP", this, 0, 36, 16);
private final BooleanSetting delay = new BooleanSetting("Delay", this, false);

/*
* Variables
*/
private boolean switching = false;
private int last_slot;
private Map < String, Item > itemMap;

public Offhand() {
super("Offhand", "Puts items in you're offhand", Keyboard.KEY_NONE, Category.Combat);
registerSettings(health, defaultHealthVal);
registerSettings(gappleInHole, delay, gappleInHoleHP, totemHp, item);
}

@Override
public void onUpdate() {
final int slot = slot();
if (slot != -1) {
swapItem(slot);
}
if (mc.player.getHeldItemOffhand().isEmpty()) {
inventorySlot(Items.END_CRYSTAL);
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {

if (mc.player == null)
return;

if (mc.currentScreen == null || mc.currentScreen instanceof GuiInventory) {

if (switching) {
swap_items(last_slot, 2);
return;
}

float hp = mc.player.getHealth() + mc.player.getAbsorptionAmount();

if (hp > totemHp.intValue()) {
if (gappleInHole.booleanValue() && hp > gappleInHoleHP.intValue() && is_in_hole()) {
swap_items(get_item_slot(Items.GOLDEN_APPLE), delay.booleanValue() ? 1 : 0);
return;
}
switch (item.value()) {
case Crystal:
swap_items(get_item_slot(Items.END_CRYSTAL), 0);
break;
case Gapple:
swap_items(get_item_slot(Items.GOLDEN_APPLE), delay.booleanValue() ? 1 : 0);
break;
case Totem:
swap_items(get_item_slot(Items.TOTEM_OF_UNDYING), delay.booleanValue() ? 1 : 0);
break;
}
} else {
swap_items(get_item_slot(Items.TOTEM_OF_UNDYING), delay.booleanValue() ? 1 : 0);
return;
}

if (mc.player.getHeldItemOffhand().getItem() == Items.AIR) {
swap_items(get_item_slot(Items.TOTEM_OF_UNDYING), delay.booleanValue() ? 1 : 0);
}

}

}
private int slot() {
if (mc.currentScreen != null) {
return -1;

public void swap_items(int slot, int step) {
if (slot == -1)
return;
if (step == 0) {
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
mc.playerController.windowClick(0, 45, 0, ClickType.PICKUP, mc.player);
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
}
final int totem = inventorySlot(Items.TOTEM_OF_UNDYING);
if (totem == -1) {
health.setDoubleValue(0.1f);
} else {
health.setDoubleValue(defaultHealthVal.doubleValue());
if (step == 1) {
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
switching = true;
last_slot = slot;
}
if (mc.player.getHealth() + mc.player.getAbsorptionAmount() <= health.doubleValue()) {
return totem;
if (step == 2) {
mc.playerController.windowClick(0, 45, 0, ClickType.PICKUP, mc.player);
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
switching = false;
}
if (mc.player.getHeldItemMainhand().getItem().equals(Items.DIAMOND_SWORD)) {
if (mc.gameSettings.keyBindUseItem.isKeyDown()) {
return inventorySlot(Items.GOLDEN_APPLE);
}

}
final int crystal = inventorySlot(Items.END_CRYSTAL);
if (crystal != -1) {
return inventorySlot(Items.END_CRYSTAL);
}
return totem;
mc.playerController.updateController();
}

private void swapItem(final int i) {
final Item item = mc.player.inventory.getStackInSlot(i).getItem();
if (!mc.player.getHeldItemOffhand().getItem().equals(item)) {
int slot = i < 9 ? i + 36 : i;
swap(new int[]{slot, 45, slot});
mc.playerController.updateController();
}
}
private boolean is_in_hole() {

private void swap(final int[] slots) {
if (mc.getConnection() != null) {
Arrays.stream(slots).forEach(i -> mc.playerController.windowClick(0, i, 0, ClickType.PICKUP, mc.player));
mc.getConnection().sendPacket(new CPacketPlayer());
}
BlockPos player_block = GetLocalPlayerPosFloored();

return mc.world.getBlockState(player_block.east()).getBlock() != Blocks.AIR &&
mc.world.getBlockState(player_block.west()).getBlock() != Blocks.AIR &&
mc.world.getBlockState(player_block.north()).getBlock() != Blocks.AIR &&
mc.world.getBlockState(player_block.south()).getBlock() != Blocks.AIR;
}

public int inventorySlot(final Item item) {
int itemSlot = -1;
for (int i = 45; i > 0; --i) {
final ItemStack stack = mc.player.inventory.getStackInSlot(i);
if (stack.getItem().equals(item)) {
itemSlot = i;
break;
private int get_item_slot(net.minecraft.item.Item input) {
if (input == mc.player.getHeldItemOffhand().getItem())
return -1;
for (int i = 36; i >= 0; i--) {
final net.minecraft.item.Item item = mc.player.inventory.getStackInSlot(i).getItem();
if (item == input) {
if (i < 9) {
if (input == Items.GOLDEN_APPLE) {
return -1;
}
i += 36;
}
return i;
}
}
return itemSlot;
return -1;
}

@Override
public void onEnable() {
super.onEnable();
AutoTotem autoTotem = (AutoTotem) ModuleManager.getModuleByName("AutoTotem");
if (autoTotem.isEnabled()) {
autoTotem.disable();
}
public BlockPos GetLocalPlayerPosFloored() {
return new BlockPos(Math.floor(mc.player.posX), Math.floor(mc.player.posY), Math.floor(mc.player.posZ));
}
}

public enum Item {
Crystal,
Gapple,
Totem
}
}
Loading

0 comments on commit b98b236

Please sign in to comment.