baritone/src/main/java/baritone/bot/utils/Helper.java

38 lines
1016 B
Java
Raw Normal View History

2018-08-01 17:10:48 +00:00
package baritone.bot.utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.multiplayer.WorldClient;
2018-08-02 14:01:34 +00:00
import net.minecraft.util.math.BlockPos;
2018-08-06 04:42:17 +00:00
import net.minecraft.util.math.Vec3d;
2018-08-05 23:56:21 +00:00
import net.minecraft.util.text.TextComponentString;
2018-08-01 17:10:48 +00:00
/**
* @author Brady
* @since 8/1/2018 12:18 AM
*/
public interface Helper {
Minecraft mc = Minecraft.getMinecraft();
2018-08-04 18:49:52 +00:00
default EntityPlayerSP player() {
return mc.player;
}
default WorldClient world() {
2018-08-04 18:49:52 +00:00
return mc.world;
}
2018-08-02 14:01:34 +00:00
default BlockPos playerFeet() {
return new BlockPos(mc.player.posX, mc.player.posY, mc.player.posZ);
2018-08-02 14:01:34 +00:00
}
2018-08-06 04:42:17 +00:00
default Vec3d playerHead() {
return new Vec3d(mc.player.posX, mc.player.posY + mc.player.getEyeHeight(), mc.player.posZ);
}
2018-08-05 23:56:21 +00:00
default void displayChatMessageRaw(String message) {
mc.ingameGUI.getChatGUI().printChatMessage(new TextComponentString(message));
}
2018-08-01 17:10:48 +00:00
}