Skip to content

Commit b98b236

Browse files
committed
1.9.1
1 parent d511aac commit b98b236

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1720
-427
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mod_id=templeclient
22
mod_name=TempleClient
33
mod_group=xyz.templecheats.templeclient
4-
mod_version=1.9.0
4+
mod_version=1.9.1
55
mod_author=["PhilipPanda"]
66
mod_description=a 1.12.2 Minecraft utility mod
77
minecraft_version=1.12.2

src/main/java/xyz/templecheats/templeclient/TempleClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
public class TempleClient {
3535
public static final String MODID = "templeclient";
3636
public static final String NAME = "Temple Client";
37-
public static final String VERSION = "1.9.0";
37+
public static final String VERSION = "1.9.1";
3838
public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
3939
public static String name = NAME + " " + VERSION;
4040
public static AnnotatedEventManager eventBus;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package xyz.templecheats.templeclient.event.events.player;
2+
3+
import net.minecraftforge.fml.common.eventhandler.Event;
4+
5+
public class JumpEvent extends Event {
6+
public final double motionX;
7+
public final double motionZ;
8+
9+
public JumpEvent(double motionX, double motionZ) {
10+
this.motionX = motionX;
11+
this.motionZ = motionZ;
12+
}
13+
}

src/main/java/xyz/templecheats/templeclient/features/gui/menu/alt/AltManager.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package xyz.templecheats.templeclient.features.gui.menu.alt;
22

33
import com.mojang.authlib.Agent;
4+
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
45
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
56
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
67
import net.minecraft.client.Minecraft;
8+
import net.minecraft.client.gui.Gui;
79
import net.minecraft.client.gui.GuiButton;
810
import net.minecraft.client.gui.GuiScreen;
911
import net.minecraft.client.gui.GuiTextField;
12+
import net.minecraft.util.ResourceLocation;
1013
import net.minecraft.util.Session;
1114
import org.lwjgl.input.Keyboard;
1215
import xyz.templecheats.templeclient.TempleClient;
1316

17+
import java.awt.*;
1418
import java.io.IOException;
1519
import java.lang.reflect.Field;
1620
import java.net.Proxy;
@@ -27,11 +31,11 @@ public class AltManager extends GuiScreen {
2731
public void initGui() {
2832
this.buttonList.clear();
2933
int centerX = this.width / 2;
30-
int centerY = this.height / 4;
31-
this.inputField = new GuiTextField(10, this.fontRenderer, centerX - 100, 25, 200, 20);
32-
this.addButton = new GuiButton(0, centerX - 100, 50, 98, 20, "Add Account");
33-
this.deleteButton = new GuiButton(1, centerX + 2, 50, 98, 20, "Delete Account");
34-
this.loginButton = new GuiButton(2, centerX - 49, 75, 98, 20, "Login");
34+
int centerY = this.height - 50;
35+
this.inputField = new GuiTextField(10, this.fontRenderer, centerX - 100, centerY - 25, 200, 20);
36+
this.addButton = new GuiButton(0, centerX - 100, centerY, 98, 20, "Add Account");
37+
this.deleteButton = new GuiButton(1, centerX + 2, centerY, 98, 20, "Delete Account");
38+
this.loginButton = new GuiButton(2, centerX - 49, centerY + 25, 98, 20, "Login");
3539
this.buttonList.add(this.addButton);
3640
this.buttonList.add(this.deleteButton);
3741
this.buttonList.add(this.loginButton);
@@ -85,11 +89,15 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
8589
int startY = 100;
8690
for (int i = 0; i < alts.size(); i++) {
8791
int posY = startY + (i * 20);
92+
drawRect(this.width / 2 - 100, posY - 10, this.width / 2 + 100, posY + 10, Color.BLACK.getRGB());
8893
if (i == selectedAltIndex) {
8994
drawCenteredString(fontRenderer, alts.get(i) + " [Selected]", this.width / 2, posY, 0xFFFF00);
9095
} else {
9196
drawCenteredString(fontRenderer, alts.get(i), this.width / 2, posY, 0xFFFFFF);
9297
}
98+
ResourceLocation skinTexture = new ResourceLocation("textures/entity/steve.png");
99+
mc.getTextureManager().bindTexture(skinTexture);
100+
Gui.drawScaledCustomSizeModalRect(this.width / 2 - 110, posY - 10, 8.0F, 8.0F, 8, 8, 20, 20, 64.0F, 64.0F);
93101
}
94102
}
95103

src/main/java/xyz/templecheats/templeclient/features/module/modules/combat/AutoTrap.java

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import xyz.templecheats.templeclient.features.module.Module;
2323
import xyz.templecheats.templeclient.util.render.shader.impl.GradientShader;
2424
import xyz.templecheats.templeclient.util.render.RenderUtil;
25-
import xyz.templecheats.templeclient.util.rotation.RotationUtil;
2625
import xyz.templecheats.templeclient.util.setting.impl.BooleanSetting;
2726
import xyz.templecheats.templeclient.util.setting.impl.DoubleSetting;
2827
import xyz.templecheats.templeclient.util.setting.impl.IntSetting;
@@ -36,7 +35,7 @@ public class AutoTrap extends Module {
3635
* Settings
3736
*/
3837
private final IntSetting blocksPerTick = new IntSetting("Blocks Per Tick", this, 1, 10, 1);
39-
private final BooleanSetting disable = new BooleanSetting("Disable", this, true);
38+
private final BooleanSetting autoDisable = new BooleanSetting("Auto Disable", this, true);
4039
private final IntSetting range = new IntSetting("Range", this, 1, 6, 4);
4140
private final BooleanSetting render = new BooleanSetting("Render", this, true);
4241
private final BooleanSetting fill = new BooleanSetting("Box Fill", this, true);
@@ -61,7 +60,7 @@ public class AutoTrap extends Module {
6160

6261
public AutoTrap() {
6362
super("AutoTrap", "Automatically traps enemies with obsidian", Keyboard.KEY_NONE, Category.Combat);
64-
registerSettings(disable, blocksPerTick, range, render, fill, outline, opacity);
63+
registerSettings(autoDisable, blocksPerTick, range, render, fill, outline, opacity);
6564
}
6665

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

90-
if (finished && disable.booleanValue())
89+
if (finished && autoDisable.booleanValue())
9190
disable();
9291

9392
int blocksPlaced = 0;
@@ -160,17 +159,28 @@ private static int getSlot(Block block) {
160159
return -1;
161160
}
162161

163-
private static void placeBlock(BlockPos pos) {
162+
public static void placeBlock(BlockPos pos) {
164163
for (EnumFacing enumFacing : EnumFacing.values()) {
165-
if (!Minecraft.getMinecraft().world.getBlockState(pos.offset(enumFacing)).getBlock().equals(Blocks.AIR) &&
166-
!isIntercepted(pos)) {
164+
if (!Minecraft.getMinecraft().world.getBlockState(pos.offset(enumFacing)).getBlock().equals(Blocks.AIR)
165+
&& !isIntercepted(pos)) {
167166
Vec3d vec = new Vec3d(pos.getX() + 0.5D + (double) enumFacing.getXOffset() * 0.5D,
168167
pos.getY() + 0.5D + (double) enumFacing.getYOffset() * 0.5D,
169168
pos.getZ() + 0.5D + (double) enumFacing.getZOffset() * 0.5D);
170-
float[] rotations = RotationUtil.rotations(pos);
169+
170+
float[] old = new float[]{Minecraft.getMinecraft().player.rotationYaw,
171+
Minecraft.getMinecraft().player.rotationPitch};
171172

172173
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketPlayer.Rotation(
173-
rotations[0], rotations[1], Minecraft.getMinecraft().player.onGround));
174+
(float) Math.toDegrees(Math.atan2((vec.z - Minecraft.getMinecraft().player.posZ),
175+
(vec.x - Minecraft.getMinecraft().player.posX))) - 90.0F,
176+
(float) (-Math.toDegrees(Math.atan2(
177+
(vec.y - (Minecraft.getMinecraft().player.posY
178+
+ (double) Minecraft.getMinecraft().player.getEyeHeight())),
179+
(Math.sqrt((vec.x - Minecraft.getMinecraft().player.posX)
180+
* (vec.x - Minecraft.getMinecraft().player.posX)
181+
+ (vec.z - Minecraft.getMinecraft().player.posZ)
182+
* (vec.z - Minecraft.getMinecraft().player.posZ)))))),
183+
Minecraft.getMinecraft().player.onGround));
174184
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketEntityAction(
175185
Minecraft.getMinecraft().player, CPacketEntityAction.Action.START_SNEAKING));
176186
Minecraft.getMinecraft().playerController.processRightClickBlock(Minecraft.getMinecraft().player,
@@ -179,8 +189,8 @@ private static void placeBlock(BlockPos pos) {
179189
Minecraft.getMinecraft().player.swingArm(EnumHand.MAIN_HAND);
180190
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketEntityAction(
181191
Minecraft.getMinecraft().player, CPacketEntityAction.Action.STOP_SNEAKING));
182-
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketPlayer.Rotation(
183-
rotations[0], rotations[1], Minecraft.getMinecraft().player.onGround));
192+
Minecraft.getMinecraft().player.connection.sendPacket(
193+
new CPacketPlayer.Rotation(old[0], old[1], Minecraft.getMinecraft().player.onGround));
184194

185195
return;
186196
}
Lines changed: 110 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,144 @@
11
package xyz.templecheats.templeclient.features.module.modules.combat;
22

3+
import net.minecraft.client.gui.inventory.GuiInventory;
4+
import net.minecraft.init.Blocks;
35
import net.minecraft.init.Items;
46
import net.minecraft.inventory.ClickType;
5-
import net.minecraft.item.Item;
6-
import net.minecraft.item.ItemStack;
7-
import net.minecraft.network.play.client.CPacketPlayer;
7+
import net.minecraft.util.math.BlockPos;
8+
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9+
import net.minecraftforge.fml.common.gameevent.TickEvent;
810
import org.lwjgl.input.Keyboard;
911
import xyz.templecheats.templeclient.features.module.Module;
10-
import xyz.templecheats.templeclient.manager.ModuleManager;
11-
import xyz.templecheats.templeclient.util.setting.impl.DoubleSetting;
12+
import xyz.templecheats.templeclient.util.setting.impl.BooleanSetting;
13+
import xyz.templecheats.templeclient.util.setting.impl.EnumSetting;
14+
import xyz.templecheats.templeclient.util.setting.impl.IntSetting;
1215

1316
import java.util.Arrays;
17+
import java.util.Map;
1418

15-
public class Offhand extends Module {
19+
public class Offhand extends Module {
1620
/*
1721
* Settings
1822
*/
19-
private final DoubleSetting health = new DoubleSetting("Health", this, 0.0d, 36.0d, 14.0d);
20-
private final DoubleSetting defaultHealthVal = new DoubleSetting("DHV", this, 0.0f, 36.0f, 14.0f);
23+
private final EnumSetting < Item > item = new EnumSetting < > ("Item", this, Item.Crystal);
24+
private final IntSetting totemHp = new IntSetting("Totem HP", this, 0, 36, 16);
25+
private final BooleanSetting gappleInHole = new BooleanSetting("Gap In Hole", this, false);
26+
private final IntSetting gappleInHoleHP = new IntSetting("Gap Hole HP", this, 0, 36, 16);
27+
private final BooleanSetting delay = new BooleanSetting("Delay", this, false);
28+
29+
/*
30+
* Variables
31+
*/
32+
private boolean switching = false;
33+
private int last_slot;
34+
private Map < String, Item > itemMap;
2135

2236
public Offhand() {
2337
super("Offhand", "Puts items in you're offhand", Keyboard.KEY_NONE, Category.Combat);
24-
registerSettings(health, defaultHealthVal);
38+
registerSettings(gappleInHole, delay, gappleInHoleHP, totemHp, item);
2539
}
2640

27-
@Override
28-
public void onUpdate() {
29-
final int slot = slot();
30-
if (slot != -1) {
31-
swapItem(slot);
32-
}
33-
if (mc.player.getHeldItemOffhand().isEmpty()) {
34-
inventorySlot(Items.END_CRYSTAL);
41+
@SubscribeEvent
42+
public void onTick(TickEvent.ClientTickEvent event) {
43+
44+
if (mc.player == null)
45+
return;
46+
47+
if (mc.currentScreen == null || mc.currentScreen instanceof GuiInventory) {
48+
49+
if (switching) {
50+
swap_items(last_slot, 2);
51+
return;
52+
}
53+
54+
float hp = mc.player.getHealth() + mc.player.getAbsorptionAmount();
55+
56+
if (hp > totemHp.intValue()) {
57+
if (gappleInHole.booleanValue() && hp > gappleInHoleHP.intValue() && is_in_hole()) {
58+
swap_items(get_item_slot(Items.GOLDEN_APPLE), delay.booleanValue() ? 1 : 0);
59+
return;
60+
}
61+
switch (item.value()) {
62+
case Crystal:
63+
swap_items(get_item_slot(Items.END_CRYSTAL), 0);
64+
break;
65+
case Gapple:
66+
swap_items(get_item_slot(Items.GOLDEN_APPLE), delay.booleanValue() ? 1 : 0);
67+
break;
68+
case Totem:
69+
swap_items(get_item_slot(Items.TOTEM_OF_UNDYING), delay.booleanValue() ? 1 : 0);
70+
break;
71+
}
72+
} else {
73+
swap_items(get_item_slot(Items.TOTEM_OF_UNDYING), delay.booleanValue() ? 1 : 0);
74+
return;
75+
}
76+
77+
if (mc.player.getHeldItemOffhand().getItem() == Items.AIR) {
78+
swap_items(get_item_slot(Items.TOTEM_OF_UNDYING), delay.booleanValue() ? 1 : 0);
79+
}
80+
3581
}
82+
3683
}
37-
private int slot() {
38-
if (mc.currentScreen != null) {
39-
return -1;
84+
85+
public void swap_items(int slot, int step) {
86+
if (slot == -1)
87+
return;
88+
if (step == 0) {
89+
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
90+
mc.playerController.windowClick(0, 45, 0, ClickType.PICKUP, mc.player);
91+
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
4092
}
41-
final int totem = inventorySlot(Items.TOTEM_OF_UNDYING);
42-
if (totem == -1) {
43-
health.setDoubleValue(0.1f);
44-
} else {
45-
health.setDoubleValue(defaultHealthVal.doubleValue());
93+
if (step == 1) {
94+
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
95+
switching = true;
96+
last_slot = slot;
4697
}
47-
if (mc.player.getHealth() + mc.player.getAbsorptionAmount() <= health.doubleValue()) {
48-
return totem;
98+
if (step == 2) {
99+
mc.playerController.windowClick(0, 45, 0, ClickType.PICKUP, mc.player);
100+
mc.playerController.windowClick(0, slot, 0, ClickType.PICKUP, mc.player);
101+
switching = false;
49102
}
50-
if (mc.player.getHeldItemMainhand().getItem().equals(Items.DIAMOND_SWORD)) {
51-
if (mc.gameSettings.keyBindUseItem.isKeyDown()) {
52-
return inventorySlot(Items.GOLDEN_APPLE);
53-
}
54103

55-
}
56-
final int crystal = inventorySlot(Items.END_CRYSTAL);
57-
if (crystal != -1) {
58-
return inventorySlot(Items.END_CRYSTAL);
59-
}
60-
return totem;
104+
mc.playerController.updateController();
61105
}
62106

63-
private void swapItem(final int i) {
64-
final Item item = mc.player.inventory.getStackInSlot(i).getItem();
65-
if (!mc.player.getHeldItemOffhand().getItem().equals(item)) {
66-
int slot = i < 9 ? i + 36 : i;
67-
swap(new int[]{slot, 45, slot});
68-
mc.playerController.updateController();
69-
}
70-
}
107+
private boolean is_in_hole() {
71108

72-
private void swap(final int[] slots) {
73-
if (mc.getConnection() != null) {
74-
Arrays.stream(slots).forEach(i -> mc.playerController.windowClick(0, i, 0, ClickType.PICKUP, mc.player));
75-
mc.getConnection().sendPacket(new CPacketPlayer());
76-
}
109+
BlockPos player_block = GetLocalPlayerPosFloored();
110+
111+
return mc.world.getBlockState(player_block.east()).getBlock() != Blocks.AIR &&
112+
mc.world.getBlockState(player_block.west()).getBlock() != Blocks.AIR &&
113+
mc.world.getBlockState(player_block.north()).getBlock() != Blocks.AIR &&
114+
mc.world.getBlockState(player_block.south()).getBlock() != Blocks.AIR;
77115
}
78116

79-
public int inventorySlot(final Item item) {
80-
int itemSlot = -1;
81-
for (int i = 45; i > 0; --i) {
82-
final ItemStack stack = mc.player.inventory.getStackInSlot(i);
83-
if (stack.getItem().equals(item)) {
84-
itemSlot = i;
85-
break;
117+
private int get_item_slot(net.minecraft.item.Item input) {
118+
if (input == mc.player.getHeldItemOffhand().getItem())
119+
return -1;
120+
for (int i = 36; i >= 0; i--) {
121+
final net.minecraft.item.Item item = mc.player.inventory.getStackInSlot(i).getItem();
122+
if (item == input) {
123+
if (i < 9) {
124+
if (input == Items.GOLDEN_APPLE) {
125+
return -1;
126+
}
127+
i += 36;
128+
}
129+
return i;
86130
}
87131
}
88-
return itemSlot;
132+
return -1;
89133
}
90134

91-
@Override
92-
public void onEnable() {
93-
super.onEnable();
94-
AutoTotem autoTotem = (AutoTotem) ModuleManager.getModuleByName("AutoTotem");
95-
if (autoTotem.isEnabled()) {
96-
autoTotem.disable();
97-
}
135+
public BlockPos GetLocalPlayerPosFloored() {
136+
return new BlockPos(Math.floor(mc.player.posX), Math.floor(mc.player.posY), Math.floor(mc.player.posZ));
98137
}
99-
}
100138

139+
public enum Item {
140+
Crystal,
141+
Gapple,
142+
Totem
143+
}
144+
}

0 commit comments

Comments
 (0)