-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlueprint.java
83 lines (69 loc) · 2.41 KB
/
Blueprint.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package Bot.minecraft;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.util.BlockPos;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
public class Blueprint {
private static boolean BlueprintToggle;
private static KeyBinding KeybindBlueprint;
private static BlockInfo FirstSelectedBlock;
private static BlockInfo SecondSelectedBlock;
public Blueprint()
{
BlueprintToggle = false;
KeybindBlueprint = new KeyBinding("key.blueprint", Keyboard.KEY_P, "key.Bot");
FirstSelectedBlock = new BlockInfo();
SecondSelectedBlock = new BlockInfo();
}
public static void RightClickHook(Minecraft mc)
{
switch(mc.objectMouseOver.typeOfHit)
{
case BLOCK:
BlockPos blockpos = mc.objectMouseOver.getBlockPos();
if (mc.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air)
{
if (FirstSelectedBlock.block == null && FirstSelectedBlock.pos == null)
{
FirstSelectedBlock.setBlockInfo(mc.theWorld.getBlockState(blockpos).getBlock(), blockpos);
}
else if (mc.theWorld.getBlockState(blockpos).getBlock().getMaterial() == FirstSelectedBlock.block.getMaterial())
{
SecondSelectedBlock.setBlockInfo(mc.theWorld.getBlockState(blockpos).getBlock(), blockpos);
}
}
}
}
public void updateShowBlueprint(Minecraft mc){
}
public void updateToggle()
{
if (IsToggleKeyPressed())
{
if (BlueprintToggle)
{
TurnOff();
} else {
TurnOn();
}
}
}
private void TurnOn(){
BlueprintToggle = true;
}
private void TurnOff(){
BlueprintToggle = false;
}
private boolean IsToggleKeyPressed(){
return KeybindBlueprint.isPressed();
}
public boolean isShowBlueprint(){
return FirstSelectedBlock != null && SecondSelectedBlock != null;
}
public static boolean GetBluePrintToggle(){
return BlueprintToggle;
}
}