├── .gitignore ├── README.md ├── README.pre.md ├── build.gradle ├── doc ├── script │ └── gh-md-toc └── tutorial │ ├── InitModVerify.JPG │ ├── blockClean.JPG │ ├── blocklyEmptyList.JPG │ ├── blocklyExecuteOnce.JPG │ ├── blocklyIf.JPG │ ├── blocklyInstallCmd.JPG │ ├── blocklyLengthOf.JPG │ ├── blocklyNT_Lists.JPG │ ├── blocklyNT_init.JPG │ ├── blocklyNT_math.JPG │ ├── blocklyNT_setSize.JPG │ ├── blocklyNameTags.JPG │ ├── blocklyTextString.JPG │ ├── blockyTickOverrides.JPG │ ├── editorChooseFile.JPG │ ├── editorInstallJavaCmd.JPG │ ├── jumpOnce.xml │ ├── jumpOnceComplete.JPG │ ├── logo.JPG │ ├── mcCmdInput.JPG │ ├── mcCommandLoaded.JPG │ ├── mcCommands.JPG │ ├── mcLaunchMod.JPG │ ├── mcModProfile.JPG │ ├── mcPaulsed.jpg │ ├── md │ ├── blocklyTutorial.md │ ├── blocklyTutorial.pre.md │ ├── installationSteps.md │ ├── javaTutorial.md │ └── javaTutorial.pre.md │ ├── modFolderExplor.JPG │ ├── playerPos.xml │ └── verifyModCreated.JPG ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── mavenRepo └── modByKids │ └── minecraftOpenMod │ ├── 1.10.2 │ ├── minecraftOpenMod-1.10.2.jar │ ├── minecraftOpenMod-1.10.2.jar.md5 │ ├── minecraftOpenMod-1.10.2.jar.sha1 │ ├── minecraftOpenMod-1.10.2.pom │ ├── minecraftOpenMod-1.10.2.pom.md5 │ └── minecraftOpenMod-1.10.2.pom.sha1 │ ├── maven-metadata-local.xml │ ├── maven-metadata.xml │ ├── maven-metadata.xml.md5 │ └── maven-metadata.xml.sha1 └── src └── main ├── blockly ├── demo │ ├── AntiAFK.xml │ ├── AntiKB.xml │ ├── ArmorStatus.xml │ ├── AutoSprint.xml │ ├── BaseFinder.xml │ ├── ChestESP.xml │ ├── Criticals.xml │ ├── Flight.xml │ ├── Freecam.xml │ ├── Fullbright.xml │ ├── KillAura.xml │ ├── NameTags.xml │ ├── NoFall.xml │ ├── ProphuntEsp.xml │ ├── Sneak.xml │ ├── Tracer.xml │ └── Xray.xml └── staging │ └── NoWeb.xml └── java └── com └── logiccity ├── md ├── PrepareTOC.java └── PreprocessMD.java └── minecraft └── api ├── BlockPos.java ├── BlocklyCatMarker.java ├── BuildStepRecord.java ├── CommandInterface.java ├── GameControl.java ├── GameInfo.java ├── ModCommandInterface.java ├── command ├── demo │ ├── AntiAFK.java │ ├── AntiKB.java │ ├── ArmorStatus.java │ ├── AutoSprint.java │ ├── BaseFinder.java │ ├── ChestESP.java │ ├── Criticals.java │ ├── Flight.java │ ├── Freecam.java │ ├── Fullbright.java │ ├── KillAura.java │ ├── NameTags.java │ ├── NoFall.java │ ├── NoWeb.java │ ├── ProphuntEsp.java │ ├── Sneak.java │ ├── SpeedMine.java │ ├── Tracer.java │ └── Xray.java ├── staging │ ├── Attack.java │ ├── BowAim.java │ ├── BowEscape.java │ ├── Coords.java │ ├── FastMaze.java │ ├── GoBack.java │ ├── GoForward.java │ ├── GoLeft.java │ ├── GoRight.java │ ├── GoToCmd.java │ ├── ListPlayers.java │ ├── SolveMaze.java │ └── Turn.java └── trial │ ├── AutoMine.java │ ├── AutoStaircase.java │ ├── BuildFloor.java │ ├── BuildLetters.java │ ├── BuildMaze.java │ ├── BuildPlay.java │ ├── BuildPole.java │ ├── BuildRecord.java │ ├── BuildStopRecord.java │ ├── BuildWall.java │ ├── Jump.java │ ├── RecordAll.java │ ├── Small.java │ ├── SmallPrymaid.java │ ├── SmallTriangle.java │ ├── TallWall.java │ ├── TallWallDiagonal.java │ ├── TallWallSide.java │ └── TpCmd.java ├── impl ├── AbstractBuildCommand.java ├── ApiCommandBase.java ├── BuildBooleanArray.java ├── CustomCommandBase.java └── CustomModCommandBase.java └── util ├── MathUtils.java ├── PathFinder.java ├── PathPoint.java └── PathUtils.java /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /.gradle 3 | /.classpath 4 | /.project 5 | /.settings 6 | /build/ 7 | /tableOfContents.sh 8 | *.pre.md.toc 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # minecraftOpenMod 2 | 3 | A modified Minecraft client that exposes a clean and simple interface to literally everyone. For someone without any programming experience, the goal is to teach Minecraft modding with visual programming tool from Google (Blockly) to quickly experience the joy of coding. For experienced Java developers, it removes the need of decompiling, deobfuscating, and studying Minecraft code. By using simple interfaces and referencing sample command implementations, one can start modding right away. 4 | 5 | Table of Contents 6 | ================= 7 | 8 | * [minecraftOpenMod](#minecraftopenmod) 9 | * [Installation](#installation) 10 | * [Using the modified Minecraft client](#using-the-modified-minecraft-client) 11 | * [To learn how to develop a custom command](#to-learn-how-to-develop-a-custom-command) 12 | * [With Blockly](#with-blockly) 13 | * [With Java](#with-java) 14 | * [Contributing](#contributing) 15 | 16 | # Installation 17 | * Install [Forge](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.10.2.html) for Minecraft version 1.10.2 18 | * Download minecraftOpenModInit.zip on the [release page](https://github.com/minecraftkids/minecraftOpenMod/releases) and copy it to the Mincraft mods folder. On windows: %appData%/minecraft/mods 19 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/modFolderExplor.JPG) 20 | * Start Minecraft client and select Forge profile. Make sure that minecraftOpenModInit is installed: 21 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/InitModVerify.JPG) 22 | * Restart the Minecraft client and notice that a new profile: "mcOpenMod" was created 23 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/verifyModCreated.JPG) 24 | * Optionally if you plan to write custom commands in Java, install the latest version of [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html); click on "Edit Profile" button for "mcOpenMod" and make sure to point the Executable to the installed JDK javaw(.exe): 25 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcModProfile.JPG) 26 | * start the game with the profile: "mcOpenMod" 27 | 28 | # Using the modified Minecraft client 29 | * Type "/." and then the "Tab" key to see a list of existing commands: 30 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCommands.JPG) 31 | Each command can be used to enable certain feature or perform a task. The command names that end with "(?)" are associated with a short cut key. When not in chat line, type the short cut key will start/stop the corresponding command. Within the chat line, typing command name preceded by "/." will start/stop the command. The MC client title bar should show current running commands as shown in the screenshot for the "Fullbright" command 32 | 33 | * Type "/-" in chat allows a command to receive additional inputs. For example, "/.attack" in chat will lists five closest living entities on the chat window. You can chose the one by typing in chat "/-" follow by a number between 1 and 5. Once selected the player will attack the entity until it was killed. "/-stop" is a special input that stop all running commands 34 | 35 | * The following are the list of commands that are associated with shotcut keys. Please see the tutorial sections on how to develop each one of them in Blockly or Java: 36 | 37 | * 'B': Fullbright 38 | * 'C': Sneak 39 | * 'F': Flight 40 | * 'G': NameTags 41 | * 'H': BaseFinder 42 | * 'I': Tracer 43 | * 'J': AutoSprint 44 | * 'K': ArmorStatus 45 | * 'L': NoFall 46 | * 'M': AntiAFK 47 | * 'N': Criticals 48 | * 'P': ChestESP 49 | * 'R': KillAura 50 | * 'U': Freecam 51 | * 'V': ProphuntEsp 52 | * 'X': Xray 53 | * 'Y': AutoBow 54 | * 'Z': AntiKB 55 | 56 | # To learn how to develop a custom command 57 | 58 | ## With Blockly 59 | Please see [Blockly tutorial](https://github.com/minecraftkids/minecraftOpenMod/blob/master/doc/tutorial/md/blocklyTutorial.md). 60 | 61 | ## With Java 62 | Please see [Java tutorial](https://github.com/minecraftkids/minecraftOpenMod/blob/master/doc/tutorial/md/javaTutorial.md). 63 | 64 | # Contributing 65 | Please help us improve by submitting [issues](https://github.com/minecraftkids/minecraftOpenMod/issues) or open [pull request](https://github.com/minecraftkids/minecraftOpenMod/pulls). 66 | 67 | -------------------------------------------------------------------------------- /README.pre.md: -------------------------------------------------------------------------------- 1 | # minecraftOpenMod 2 | 3 | A modified Minecraft client that exposes a clean and simple interface to literally everyone. For someone without any programming experience, the goal is to teach Minecraft modding with visual programming tool from Google (Blockly) to quickly experience the joy of coding. For experienced Java developers, it removes the need of decompiling, deobfuscating, and studying Minecraft code. By using simple interfaces and referencing sample command implementations, one can start modding right away. 4 | 5 | <> 6 | 7 | # Installation 8 | <> 9 | 10 | # Using the modified Minecraft client 11 | * Type "/." and then the "Tab" key to see a list of existing commands: 12 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCommands.JPG) 13 | Each command can be used to enable certain feature or perform a task. The command names that end with "(?)" are associated with a short cut key. When not in chat line, type the short cut key will start/stop the corresponding command. Within the chat line, typing command name preceded by "/." will start/stop the command. The MC client title bar should show current running commands as shown in the screenshot for the "Fullbright" command 14 | 15 | * Type "/-" in chat allows a command to receive additional inputs. For example, "/.attack" in chat will lists five closest living entities on the chat window. You can chose the one by typing in chat "/-" follow by a number between 1 and 5. Once selected the player will attack the entity until it was killed. "/-stop" is a special input that stop all running commands 16 | 17 | * The following are the list of commands that are associated with shotcut keys. Please see the tutorial sections on how to develop each one of them in Blockly or Java: 18 | 19 | * 'B': Fullbright 20 | * 'C': Sneak 21 | * 'F': Flight 22 | * 'G': NameTags 23 | * 'H': BaseFinder 24 | * 'I': Tracer 25 | * 'J': AutoSprint 26 | * 'K': ArmorStatus 27 | * 'L': NoFall 28 | * 'M': AntiAFK 29 | * 'N': Criticals 30 | * 'P': ChestESP 31 | * 'R': KillAura 32 | * 'U': Freecam 33 | * 'V': ProphuntEsp 34 | * 'X': Xray 35 | * 'Y': AutoBow 36 | * 'Z': AntiKB 37 | 38 | # To learn how to develop a custom command 39 | 40 | ## With Blockly 41 | Please see [Blockly tutorial](https://github.com/minecraftkids/minecraftOpenMod/blob/master/doc/tutorial/md/blocklyTutorial.md). 42 | 43 | ## With Java 44 | Please see [Java tutorial](https://github.com/minecraftkids/minecraftOpenMod/blob/master/doc/tutorial/md/javaTutorial.md). 45 | 46 | # Contributing 47 | Please help us improve by submitting [issues](https://github.com/minecraftkids/minecraftOpenMod/issues) or open [pull request](https://github.com/minecraftkids/minecraftOpenMod/pulls). 48 | 49 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | task wrapper(type: Wrapper) { 4 | gradleVersion = '2.9' 5 | } 6 | 7 | task mdInclude(dependsOn: 'createTableOfContent', type:JavaExec) { 8 | main = "com.logiccity.md.PreprocessMD" 9 | classpath = sourceSets.main.runtimeClasspath 10 | } 11 | 12 | task prepareTOC(type:JavaExec) { 13 | main = "com.logiccity.md.PrepareTOC" 14 | classpath = sourceSets.main.runtimeClasspath 15 | } 16 | 17 | task createTableOfContent(dependsOn: 'prepareTOC', type: Exec) { 18 | executable "sh" 19 | args "-c", "./tableOfContents.sh" 20 | } -------------------------------------------------------------------------------- /doc/script/gh-md-toc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Steps: 5 | # 6 | # 1. Download corresponding html file for some README.md: 7 | # curl -s $1 8 | # 9 | # 2. Discard rows where no substring 'user-content-' (github's markup): 10 | # awk '/user-content-/ { ... 11 | # 12 | # 3.1 Get last number in each row like ' ... sitemap.js'. 13 | # It's a level of the current header (NF — number of fields): 14 | # substr($NF, length($NF)-1, 1) 15 | # 16 | # 3.2 Get level from 3.1 and insert corresponding number of spaces before '*': 17 | # sprintf("%*s", substr($NF, length($NF)-1, 1)*2, " ") 18 | # 19 | # 4. Find head's text and insert it inside "* [ ... ]": 20 | # substr($0, match($0, /a>.*<\/h/)+2, RLENGTH-5) 21 | # 22 | # 5. Find anchor and insert it inside "(...)": 23 | # substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) 24 | # 25 | 26 | gh_toc_version="0.4.6" 27 | 28 | gh_user_agent="gh-md-toc v$gh_toc_version" 29 | 30 | # 31 | # Download rendered into html README.md by its url. 32 | # 33 | # 34 | gh_toc_load() { 35 | local gh_url=$1 36 | 37 | if type curl &>/dev/null; then 38 | curl --user-agent "$gh_user_agent" -s "$gh_url" 39 | elif type wget &>/dev/null; then 40 | wget --user-agent="$gh_user_agent" -qO- "$gh_url" 41 | else 42 | echo "Please, install 'curl' or 'wget' and try again." 43 | exit 1 44 | fi 45 | } 46 | 47 | # 48 | # Converts local md file into html by GitHub 49 | # 50 | # ➥ curl -X POST --data '{"text": "Hello world github/linguist#1 **cool**, and #1!"}' https://api.github.com/markdown 51 | #

Hello world github/linguist#1 cool, and #1!

'" 52 | gh_toc_md2html() { 53 | local gh_file_md=$1 54 | curl -s --user-agent "$gh_user_agent" \ 55 | --data-binary @"$gh_file_md" -H "Content-Type:text/plain" \ 56 | https://api.github.com/markdown/raw 57 | } 58 | 59 | # 60 | # Is passed string url 61 | # 62 | gh_is_url() { 63 | if [[ $1 == https* || $1 == http* ]]; then 64 | echo "yes" 65 | else 66 | echo "no" 67 | fi 68 | } 69 | 70 | # 71 | # TOC generator 72 | # 73 | gh_toc(){ 74 | local gh_src=$1 75 | local gh_src_copy=$1 76 | local gh_ttl_docs=$2 77 | 78 | if [ "$gh_src" = "" ]; then 79 | echo "Please, enter URL or local path for a README.md" 80 | exit 1 81 | fi 82 | 83 | 84 | # Show "TOC" string only if working with one document 85 | if [ "$gh_ttl_docs" = "1" ]; then 86 | 87 | echo "Table of Contents" 88 | echo "=================" 89 | echo "" 90 | gh_src_copy="" 91 | 92 | fi 93 | 94 | if [ "$(gh_is_url "$gh_src")" == "yes" ]; then 95 | gh_toc_load "$gh_src" | gh_toc_grab "$gh_src_copy" 96 | else 97 | gh_toc_md2html "$gh_src" | gh_toc_grab "$gh_src_copy" 98 | fi 99 | } 100 | 101 | GH_GREP="grep -E --null-data --text -o" 102 | if [ "$(uname)" = "Darwin" ]; then 103 | GH_GREP="grep -E --text -o" 104 | fi 105 | 106 | # 107 | # Grabber of the TOC from rendered html 108 | # 109 | # $1 — a source url of document. 110 | # It's need if TOC is generated for multiple documents. 111 | # 112 | gh_toc_grab() { 113 | # find strings that corresponds to template 114 | #'\s*]*>\s*\s*.*?\s*\s*]*>.*?.*?\s*//' | sed 's/<\/code>//' | 123 | # now all rows are like: 124 | #

... .*<\/h/)+2, RLENGTH-5)"](" gh_url substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) ")"}' | sed 'y/+/ /; s/%/\\x/g')" 128 | } 129 | 130 | # 131 | # Returns filename only from full path or url 132 | # 133 | gh_toc_get_filename() { 134 | echo "${1##*/}" 135 | } 136 | 137 | # 138 | # Options hendlers 139 | # 140 | gh_toc_app() { 141 | local app_name="gh-md-toc" 142 | 143 | if [ "$1" = '--help' ] || [ $# -eq 0 ] ; then 144 | echo "GitHub TOC generator ($app_name): $gh_toc_version" 145 | echo "" 146 | echo "Usage:" 147 | echo " $app_name src [src] Create TOC for a README file (url or local path)" 148 | echo " $app_name - Create TOC for markdown from STDIN" 149 | echo " $app_name --help Show help" 150 | echo " $app_name --version Show version" 151 | return 152 | fi 153 | 154 | if [ "$1" = '--version' ]; then 155 | echo "$gh_toc_version" 156 | return 157 | fi 158 | 159 | if [ "$1" = "-" ]; then 160 | if [ -z "$TMPDIR" ]; then 161 | TMPDIR="/tmp" 162 | elif [ -n "$TMPDIR" -a ! -d "$TMPDIR" ]; then 163 | mkdir -p "$TMPDIR" 164 | fi 165 | local gh_tmp_md 166 | gh_tmp_md=$(mktemp $TMPDIR/tmp.XXXXXX) 167 | while read input; do 168 | echo "$input" >> "$gh_tmp_md" 169 | done 170 | gh_toc_md2html "$gh_tmp_md" | gh_toc_grab "" 171 | return 172 | fi 173 | 174 | for md in "$@" 175 | do 176 | echo "" 177 | gh_toc "$md" "$#" 178 | done 179 | 180 | echo "" 181 | echo "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)" 182 | } 183 | 184 | # 185 | # Entry point 186 | # 187 | gh_toc_app "$@" 188 | -------------------------------------------------------------------------------- /doc/tutorial/InitModVerify.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/InitModVerify.JPG -------------------------------------------------------------------------------- /doc/tutorial/blockClean.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blockClean.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyEmptyList.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyEmptyList.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyExecuteOnce.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyExecuteOnce.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyIf.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyIf.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyInstallCmd.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyInstallCmd.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyLengthOf.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyLengthOf.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyNT_Lists.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyNT_Lists.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyNT_init.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyNT_init.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyNT_math.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyNT_math.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyNT_setSize.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyNT_setSize.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyNameTags.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyNameTags.JPG -------------------------------------------------------------------------------- /doc/tutorial/blocklyTextString.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blocklyTextString.JPG -------------------------------------------------------------------------------- /doc/tutorial/blockyTickOverrides.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/blockyTickOverrides.JPG -------------------------------------------------------------------------------- /doc/tutorial/editorChooseFile.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/editorChooseFile.JPG -------------------------------------------------------------------------------- /doc/tutorial/editorInstallJavaCmd.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/editorInstallJavaCmd.JPG -------------------------------------------------------------------------------- /doc/tutorial/jumpOnce.xml: -------------------------------------------------------------------------------- 1 | test1execute oncePerform an one time task -------------------------------------------------------------------------------- /doc/tutorial/jumpOnceComplete.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/jumpOnceComplete.JPG -------------------------------------------------------------------------------- /doc/tutorial/logo.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/logo.JPG -------------------------------------------------------------------------------- /doc/tutorial/mcCmdInput.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/mcCmdInput.JPG -------------------------------------------------------------------------------- /doc/tutorial/mcCommandLoaded.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/mcCommandLoaded.JPG -------------------------------------------------------------------------------- /doc/tutorial/mcCommands.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/mcCommands.JPG -------------------------------------------------------------------------------- /doc/tutorial/mcLaunchMod.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/mcLaunchMod.JPG -------------------------------------------------------------------------------- /doc/tutorial/mcModProfile.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/mcModProfile.JPG -------------------------------------------------------------------------------- /doc/tutorial/mcPaulsed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/mcPaulsed.jpg -------------------------------------------------------------------------------- /doc/tutorial/md/blocklyTutorial.md: -------------------------------------------------------------------------------- 1 | Table of Contents 2 | ================= 3 | 4 | * [Install and start the modified Minecraft client](#install-and-start-the-modified-minecraft-client) 5 | * [Commands that execute actions only once](#commands-that-execute-actions-only-once) 6 | * ["NameTags" in source code editor](#nametags-in-source-code-editor) 7 | * [Commands that performs actions in each update tick](#commands-that-performs-actions-in-each-update-tick) 8 | 9 | # Install and start the modified Minecraft client 10 | * Install [Forge](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.10.2.html) for Minecraft version 1.10.2 11 | * Download minecraftOpenModInit.zip on the [release page](https://github.com/minecraftkids/minecraftOpenMod/releases) and copy it to the Mincraft mods folder. On windows: %appData%/minecraft/mods 12 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/modFolderExplor.JPG) 13 | * Start Minecraft client and select Forge profile. Make sure that minecraftOpenModInit is installed: 14 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/InitModVerify.JPG) 15 | * Restart the Minecraft client and notice that a new profile: "mcOpenMod" was created 16 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/verifyModCreated.JPG) 17 | * Optionally if you plan to write custom commands in Java, install the latest version of [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html); click on "Edit Profile" button for "mcOpenMod" and make sure to point the Executable to the installed JDK javaw(.exe): 18 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcModProfile.JPG) 19 | * start the game with the profile: "mcOpenMod" 20 | 21 | # Commands that execute actions only once 22 | ## "NameTags" in source code editor 23 | * If Minecraft client is running, use Esc key to pause the game: 24 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcPaulsed.jpg) 25 | * Download sourceEditor.zip on the [release page](../releases) 26 | * Unzip the content and open the mod/index.html file in any browser. You will see the Brockly UI: 27 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blockClean.JPG) 28 | * Drag the following highlighted blocks onto the canvas: 29 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_init.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyExecuteOnce.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyIf.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_Lists.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_math.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_setSize.JPG) 30 | 31 | * The completed "NameTags" command is: 32 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNameTags.JPG) 33 | * The command contains two methods: 34 | * The "Create the command" method creates the command with name: "NameTags". It also bind the command to short cut key: "G" 35 | * The "execute once" defines the actions of the command. It set the size of name label above players. If there is an argument passed to the command, it will be used as the size of label, otherwise the default sized of 2 will be used 36 | * Now to install the command, click on the "Install command" button: 37 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyInstallCmd.JPG) 38 | * Switch to the Minecraft client and notice the background chat message: 39 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCommandLoaded.JPG) 40 | * To run the command, type "/.NameTags" on the chat line. You have to be in multi-player world to see the name label of other players. Try switch between "/.NameTags 1" and "/.NameTags 2" to see the difference 41 | * Congratulation you completed your first command! 42 | 43 | # Commands that performs actions in each update tick 44 | 45 | The previous command executes a single action once. A more complex example would be to continuously perform actions and check on status until the command is stopped or a certain goal is achieved. Minecraft's game loop normally runs at a fixed rate of 20 ticks per second. The following highlighted blocks can be used to insert additional actions to change game status or UI rendering: 46 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blockyTickOverrides.JPG) 47 | 48 | The key to these blocks is that their actions will be executed many times per second. All of them return a Boolean value. A false value means the command actions will continue to be invoked in the following tick. A true value signal the goal of this command is achieved and it will stop the command. Please take a look at the xml sources in [Blockly Demo](https://github.com/minecraftkids/minecraftOpenMod/tree/master/src/main/blockly/demo) for the following example commands with shortcut keys: 49 | 50 | * 'B': Fullbright 51 | * 'C': Sneak 52 | * 'F': Flight 53 | * 'H': BaseFinder 54 | * 'I': Tracer 55 | * 'J': AutoSprint 56 | * 'K': ArmorStatus 57 | * 'L': NoFall 58 | * 'M': AntiAFK 59 | * 'N': Criticals 60 | * 'P': ChestESP 61 | * 'R': KillAura 62 | * 'U': Freecam 63 | * 'V': ProphuntEsp 64 | * 'X': Xray 65 | * 'Y': AutoBow 66 | * 'Z': AntiKB 67 | 68 | To load an xml source, please use "Choose File" button on the Blockly UI: 69 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/editorChooseFile.JPG) 70 | 71 | -------------------------------------------------------------------------------- /doc/tutorial/md/blocklyTutorial.pre.md: -------------------------------------------------------------------------------- 1 | <> 2 | 3 | # Install and start the modified Minecraft client 4 | <> 5 | 6 | # Commands that execute actions only once 7 | ## "NameTags" in source code editor 8 | * If Minecraft client is running, use Esc key to pause the game: 9 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcPaulsed.jpg) 10 | * Download sourceEditor.zip on the [release page](../releases) 11 | * Unzip the content and open the mod/index.html file in any browser. You will see the Brockly UI: 12 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blockClean.JPG) 13 | * Drag the following highlighted blocks onto the canvas: 14 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_init.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyExecuteOnce.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyIf.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_Lists.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_math.JPG)![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNT_setSize.JPG) 15 | 16 | * The completed "NameTags" command is: 17 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyNameTags.JPG) 18 | * The command contains two methods: 19 | * The "Create the command" method creates the command with name: "NameTags". It also bind the command to short cut key: "G" 20 | * The "execute once" defines the actions of the command. It set the size of name label above players. If there is an argument passed to the command, it will be used as the size of label, otherwise the default sized of 2 will be used 21 | * Now to install the command, click on the "Install command" button: 22 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blocklyInstallCmd.JPG) 23 | * Switch to the Minecraft client and notice the background chat message: 24 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCommandLoaded.JPG) 25 | * To run the command, type "/.NameTags" on the chat line. You have to be in multi-player world to see the name label of other players. Try switch between "/.NameTags 1" and "/.NameTags 2" to see the difference 26 | * Congratulation you completed your first command! 27 | 28 | # Commands that performs actions in each update tick 29 | 30 | The previous command executes a single action once. A more complex example would be to continuously perform actions and check on status until the command is stopped or a certain goal is achieved. Minecraft's game loop normally runs at a fixed rate of 20 ticks per second. The following highlighted blocks can be used to insert additional actions to change game status or UI rendering: 31 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/blockyTickOverrides.JPG) 32 | 33 | The key to these blocks is that their actions will be executed many times per second. All of them return a Boolean value. A false value means the command actions will continue to be invoked in the following tick. A true value signal the goal of this command is achieved and it will stop the command. Please take a look at the xml sources in [Blockly Demo](https://github.com/minecraftkids/minecraftOpenMod/tree/master/src/main/blockly/demo) for the following example commands with shortcut keys: 34 | 35 | * 'B': Fullbright 36 | * 'C': Sneak 37 | * 'F': Flight 38 | * 'H': BaseFinder 39 | * 'I': Tracer 40 | * 'J': AutoSprint 41 | * 'K': ArmorStatus 42 | * 'L': NoFall 43 | * 'M': AntiAFK 44 | * 'N': Criticals 45 | * 'P': ChestESP 46 | * 'R': KillAura 47 | * 'U': Freecam 48 | * 'V': ProphuntEsp 49 | * 'X': Xray 50 | * 'Y': AutoBow 51 | * 'Z': AntiKB 52 | 53 | To load an xml source, please use "Choose File" button on the Blockly UI: 54 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/editorChooseFile.JPG) 55 | 56 | -------------------------------------------------------------------------------- /doc/tutorial/md/installationSteps.md: -------------------------------------------------------------------------------- 1 | * Install [Forge](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.10.2.html) for Minecraft version 1.10.2 2 | * Download minecraftOpenModInit.zip on the [release page](https://github.com/minecraftkids/minecraftOpenMod/releases) and copy it to the Mincraft mods folder. On windows: %appData%/minecraft/mods 3 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/modFolderExplor.JPG) 4 | * Start Minecraft client and select Forge profile. Make sure that minecraftOpenModInit is installed: 5 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/InitModVerify.JPG) 6 | * Restart the Minecraft client and notice that a new profile: "mcOpenMod" was created 7 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/verifyModCreated.JPG) 8 | * Optionally if you plan to write custom commands in Java, install the latest version of [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html); click on "Edit Profile" button for "mcOpenMod" and make sure to point the Executable to the installed JDK javaw(.exe): 9 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcModProfile.JPG) 10 | * start the game with the profile: "mcOpenMod" -------------------------------------------------------------------------------- /doc/tutorial/md/javaTutorial.md: -------------------------------------------------------------------------------- 1 | Table of Contents 2 | ================= 3 | 4 | * [Install and start the modified Minecraft client](#install-and-start-the-modified-minecraft-client) 5 | * [Setup IDE](#setup-ide) 6 | * [Create and install your own command](#create-and-install-your-own-command) 7 | * [Command super classes CustomCommandBase vs CustomModCommandBase ](#command-super-classes-customcommandbase-vs-custommodcommandbase) 8 | * [Sample Commands](#sample-commands) 9 | 10 | # Install and start the modified Minecraft client 11 | * Install [Forge](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.10.2.html) for Minecraft version 1.10.2 12 | * Download minecraftOpenModInit.zip on the [release page](https://github.com/minecraftkids/minecraftOpenMod/releases) and copy it to the Mincraft mods folder. On windows: %appData%/minecraft/mods 13 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/modFolderExplor.JPG) 14 | * Start Minecraft client and select Forge profile. Make sure that minecraftOpenModInit is installed: 15 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/InitModVerify.JPG) 16 | * Restart the Minecraft client and notice that a new profile: "mcOpenMod" was created 17 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/verifyModCreated.JPG) 18 | * Optionally if you plan to write custom commands in Java, install the latest version of [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html); click on "Edit Profile" button for "mcOpenMod" and make sure to point the Executable to the installed JDK javaw(.exe): 19 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcModProfile.JPG) 20 | * start the game with the profile: "mcOpenMod" 21 | 22 | # Setup IDE 23 | You can use any Java IDE for this project. There is no third party dependencies out side of JRE. 24 | If you are interested in using the popular [Eclipse](https://eclipse.org/)/[Gradle](http://gradle.org/) setup: 25 | * [Install Gradle Plugin](https://github.com/eclipse/buildship/blob/master/docs/user/Installation.md) 26 | * Clone the [current repo](https://github.com/minecraftkids/minecraftOpenMod) 27 | * Import the cloned repo as a Gradle project 28 | 29 | # Create and install your own command 30 | * If Minecraft client is running, use Esc key to pause the game: 31 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcPaulsed.jpg) 32 | * As an example, open the Jump.java class in com.logiccity.minecraft.api.command.trial package. Change `super("jump");` to `super("jumpOnce");` and save the file 33 | * Download sourceEditor.zip on the [release page](../releases) 34 | * Unzip the content and open the mod/index.html file in any browser. Click on the "Choose File" button: 35 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/editorChooseFile.JPG) 36 | * Browse to load the Jump.java file. Click on the "Install command" button: 37 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/editorInstallJavaCmd.JPG) 38 | * Switch to the Minecraft client and notice the background chat message: 39 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCommandLoaded.JPG) 40 | * To run the command, type "/.jumpOnce" on the chat line: 41 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCmdInput.JPG) 42 | * You can use "/" and up arrow to repeat the command several times. You will notice each time you run the command, the player jumps once. 43 | * Congratulation you completed your first command! 44 | 45 | # Command super classes `CustomCommandBase` vs `CustomModCommandBase` 46 | 47 | The "jumpOnce" command extends from class `CustomCommandBase`, it executes a single action once. A more complex example would be to perform actions and check on status until the command is stopped or a certain goal is achieved. Minecraft's game loop normally runs at a fixed rate of 20 ticks per second. There are special threads to handle game status update and UI rendering. To perform action in those threads, a command needs extend from `CustomModCommandBase` and override the methods: 48 | * `boolean doInUpdateTicThread()` 49 | * `boolean doInRenderTicThread()` 50 | * `boolean doInPostInGameRenderTicThread()` 51 | 52 | These methods will be executed many times per second. All of them return a Boolean value. A false value means the command actions will continue to be invoked in the following tick. A true value signal the goal of this command is achieved and it will stop the command. Along with super classes, all commands must implement either [CommandInterface](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/CommandInterface.html) or [ModCommandInterface](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/ModCommandInterface.html). The main interfaces to Minecraft code are [GameInfo](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/GameInfo.html) and [GameControl](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/GameControl.html) 53 | 54 | # Sample Commands 55 | 56 | Please take a look at the source code in [Java Demos](https://github.com/minecraftkids/minecraftOpenMod/tree/master/src/main/java/com/logiccity/minecraft/api/command/demo) for the following example commands with shortcut keys: 57 | 58 | * 'B': Fullbright 59 | * 'C': Sneak 60 | * 'F': Flight 61 | * 'G': NameTags 62 | * 'H': BaseFinder 63 | * 'I': Tracer 64 | * 'J': AutoSprint 65 | * 'K': ArmorStatus 66 | * 'L': NoFall 67 | * 'M': AntiAFK 68 | * 'N': Criticals 69 | * 'P': ChestESP 70 | * 'R': KillAura 71 | * 'U': Freecam 72 | * 'V': ProphuntEsp 73 | * 'X': Xray 74 | * 'Y': AutoBow 75 | * 'Z': AntiKB 76 | 77 | -------------------------------------------------------------------------------- /doc/tutorial/md/javaTutorial.pre.md: -------------------------------------------------------------------------------- 1 | <> 2 | 3 | # Install and start the modified Minecraft client 4 | <> 5 | 6 | # Setup IDE 7 | You can use any Java IDE for this project. There is no third party dependencies out side of JRE. 8 | If you are interested in using the popular [Eclipse](https://eclipse.org/)/[Gradle](http://gradle.org/) setup: 9 | * [Install Gradle Plugin](https://github.com/eclipse/buildship/blob/master/docs/user/Installation.md) 10 | * Clone the [current repo](https://github.com/minecraftkids/minecraftOpenMod) 11 | * Import the cloned repo as a Gradle project 12 | 13 | # Create and install your own command 14 | * If Minecraft client is running, use Esc key to pause the game: 15 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcPaulsed.jpg) 16 | * As an example, open the Jump.java class in com.logiccity.minecraft.api.command.trial package. Change `super("jump");` to `super("jumpOnce");` and save the file 17 | * Download sourceEditor.zip on the [release page](../releases) 18 | * Unzip the content and open the mod/index.html file in any browser. Click on the "Choose File" button: 19 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/editorChooseFile.JPG) 20 | * Browse to load the Jump.java file. Click on the "Install command" button: 21 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/editorInstallJavaCmd.JPG) 22 | * Switch to the Minecraft client and notice the background chat message: 23 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCommandLoaded.JPG) 24 | * To run the command, type "/.jumpOnce" on the chat line: 25 | ![](https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/master/doc/tutorial/mcCmdInput.JPG) 26 | * You can use "/" and up arrow to repeat the command several times. You will notice each time you run the command, the player jumps once. 27 | * Congratulation you completed your first command! 28 | 29 | # Command super classes `CustomCommandBase` vs `CustomModCommandBase` 30 | 31 | The "jumpOnce" command extends from class `CustomCommandBase`, it executes a single action once. A more complex example would be to perform actions and check on status until the command is stopped or a certain goal is achieved. Minecraft's game loop normally runs at a fixed rate of 20 ticks per second. There are special threads to handle game status update and UI rendering. To perform action in those threads, a command needs extend from `CustomModCommandBase` and override the methods: 32 | * `boolean doInUpdateTicThread()` 33 | * `boolean doInRenderTicThread()` 34 | * `boolean doInPostInGameRenderTicThread()` 35 | 36 | These methods will be executed many times per second. All of them return a Boolean value. A false value means the command actions will continue to be invoked in the following tick. A true value signal the goal of this command is achieved and it will stop the command. Along with super classes, all commands must implement either [CommandInterface](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/CommandInterface.html) or [ModCommandInterface](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/ModCommandInterface.html). The main interfaces to Minecraft code are [GameInfo](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/GameInfo.html) and [GameControl](http://minecraftkids.github.io/minecraftOpenMod/com/logiccity/minecraft/api/GameControl.html) 37 | 38 | # Sample Commands 39 | 40 | Please take a look at the source code in [Java Demos](https://github.com/minecraftkids/minecraftOpenMod/tree/master/src/main/java/com/logiccity/minecraft/api/command/demo) for the following example commands with shortcut keys: 41 | 42 | * 'B': Fullbright 43 | * 'C': Sneak 44 | * 'F': Flight 45 | * 'G': NameTags 46 | * 'H': BaseFinder 47 | * 'I': Tracer 48 | * 'J': AutoSprint 49 | * 'K': ArmorStatus 50 | * 'L': NoFall 51 | * 'M': AntiAFK 52 | * 'N': Criticals 53 | * 'P': ChestESP 54 | * 'R': KillAura 55 | * 'U': Freecam 56 | * 'V': ProphuntEsp 57 | * 'X': Xray 58 | * 'Y': AutoBow 59 | * 'Z': AntiKB 60 | 61 | -------------------------------------------------------------------------------- /doc/tutorial/modFolderExplor.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/modFolderExplor.JPG -------------------------------------------------------------------------------- /doc/tutorial/playerPos.xml: -------------------------------------------------------------------------------- 1 | playerPosexecute oncePerform an one time taskbpbp, bp, bp -------------------------------------------------------------------------------- /doc/tutorial/verifyModCreated.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/doc/tutorial/verifyModCreated.JPG -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 20 15:58:55 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/1.10.2/minecraftOpenMod-1.10.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/mavenRepo/modByKids/minecraftOpenMod/1.10.2/minecraftOpenMod-1.10.2.jar -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/1.10.2/minecraftOpenMod-1.10.2.jar.md5: -------------------------------------------------------------------------------- 1 | 8da6b842513f5a83d6124f55a2d23c5d -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/1.10.2/minecraftOpenMod-1.10.2.jar.sha1: -------------------------------------------------------------------------------- 1 | 33b94d8c722679cdddd180ee2d66a9b68d14f7f7 -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/1.10.2/minecraftOpenMod-1.10.2.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | modByKids 6 | minecraftOpenMod 7 | 1.10.2 8 | 9 | -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/1.10.2/minecraftOpenMod-1.10.2.pom.md5: -------------------------------------------------------------------------------- 1 | 14811d71e65ca9ad3702cc64bf5edda5 -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/1.10.2/minecraftOpenMod-1.10.2.pom.sha1: -------------------------------------------------------------------------------- 1 | 26f86ece03bb1a376cbc087a7bbea74edf2b91a3 -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/maven-metadata-local.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | modByKids 4 | minecraftOpenMod 5 | 6 | 1.10.2 7 | 8 | 1.10.2 9 | 10 | 20160711015331 11 | 12 | 13 | -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | modByKids 4 | minecraftOpenMod 5 | 6 | 1.10.2 7 | 8 | 1.10.2 9 | 10 | 20160720222654 11 | 12 | 13 | -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/maven-metadata.xml.md5: -------------------------------------------------------------------------------- 1 | 4b81a71d11c2d8f480d9b37562a47fad -------------------------------------------------------------------------------- /mavenRepo/modByKids/minecraftOpenMod/maven-metadata.xml.sha1: -------------------------------------------------------------------------------- 1 | d03df5246863b14299abfc36d650e3014f35be3f -------------------------------------------------------------------------------- /src/main/blockly/demo/AntiAFK.xml: -------------------------------------------------------------------------------- 1 | AntiAFKMinitialize the commandInitialized the commandblockcleanup commandCleanup commandFALSEdo in each update tickDo in each update tick3000nextBlockblock1-2100301-21003yawnextBlockGTABS9MINUS1yaw10.1turnyawGTnextBlocknextBlocknextBlock1TRUEFALSEFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/AntiKB.xml: -------------------------------------------------------------------------------- 1 | AntiKBZinitialize the commandInitialized the commandFALSEcleanup commandCleanup commandTRUE -------------------------------------------------------------------------------- /src/main/blockly/demo/ArmorStatus.xml: -------------------------------------------------------------------------------- 1 | ArmorStatus0,1,2,3,4Kinitialize the commandInitialized the commandlistModeverticalalignModebottomLeftshowPercentFALSEshowMaxDamageTRUEGT0listModeGETFIRSTGT1alignModeGETFROM_START2GT2showPercentEQGETFROM_START3trueGT3showMaxDamageEQGETFROM_START4truelistModealignModeshowPercentshowMaxDamagedo in each post render tickDo in each post render tickFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/AutoSprint.xml: -------------------------------------------------------------------------------- 1 | AutoSprintSdo in each update tickDo in each update tickANDANDGT0TRUEFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/BaseFinder.xml: -------------------------------------------------------------------------------- 1 | BaseFinder0,1,2Hdo in each render tickDo in each render tickFALSEinitialize the commandInitialized the commandGT0maxBlocksGETFIRSTGT1maxBlocksGETFROM_START2maxBlocks50do in each update tickDo in each update tick3000FALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/ChestESP.xml: -------------------------------------------------------------------------------- 1 | ChestESPPdo in each render tickDo in each render tickmaxedANDmaxedshouldInformFound a lot of chestsTo prevent lag, it will only show the first maxChests chestsshouldInformFALSEmaxedshouldInformTRUEFALSEinitialize the commandInitialized the commandshouldInformTRUEGT0maxChestsGETFIRSTmaxChests1000 -------------------------------------------------------------------------------- /src/main/blockly/demo/Criticals.xml: -------------------------------------------------------------------------------- 1 | CriticalsNdo in each update tickDo in each update tick200blockBelow0-10ANDblockBelow0.10.1FALSEFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/Flight.xml: -------------------------------------------------------------------------------- 1 | FlightFinitialize the commandInitialized the commandNoFalldo in each update tickDo in each update tick0.2-0.2-0.02FALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/Freecam.xml: -------------------------------------------------------------------------------- 1 | FreecamUdo in each update tickDo in each update tick00.1ADD11MINUS11FALSEinitialize the commandInitialized the commandoldXoldYoldZ-69cleanup commandCleanup commandoldXoldYoldZ-69 -------------------------------------------------------------------------------- /src/main/blockly/demo/Fullbright.xml: -------------------------------------------------------------------------------- 1 | FullbrightBdo in each update tickDo in each update tickbrightnessLTbrightness16ADD1brightness10.5FALSEcleanup commandCleanup command0 -------------------------------------------------------------------------------- /src/main/blockly/demo/KillAura.xml: -------------------------------------------------------------------------------- 1 | KillAuraRinitialize the commandInitialized the commandwaitMS12rangeSQ18GT0waitMSGETFIRSTGT1rangeGETFROM_START2rangeSQMULTIPLY1range1rangedo in each update tickDo in each update tickcloseEs1FALSEGTcloseEs0enGETFIRSTcloseEsbpenLTEbpbpbprangeSQwaitMSCriticalsCriticalsenFALSECriticalsCriticalsFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/NameTags.xml: -------------------------------------------------------------------------------- 1 | NameTagsGexecute oncePerform an one time task2GETFIRST -------------------------------------------------------------------------------- /src/main/blockly/demo/NoFall.xml: -------------------------------------------------------------------------------- 1 | NoFallLdo in each update tickDo in each update tickFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/ProphuntEsp.xml: -------------------------------------------------------------------------------- 1 | ProphuntEspVdo in each render tickDo in each render tickFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/Sneak.xml: -------------------------------------------------------------------------------- 1 | SneakCinitialize the commandInitialized the commandTRUEcleanup commandCleanup commandFALSEFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/Tracer.xml: -------------------------------------------------------------------------------- 1 | TracerIdo in each render tickDo in each render tickFALSE -------------------------------------------------------------------------------- /src/main/blockly/demo/Xray.xml: -------------------------------------------------------------------------------- 1 | XrayXinitialize the commandInitialized the commandcleanup commandCleanup command -------------------------------------------------------------------------------- /src/main/blockly/staging/NoWeb.xml: -------------------------------------------------------------------------------- 1 | NoWebdo in each update tickDo in each update tickFALSE -------------------------------------------------------------------------------- /src/main/java/com/logiccity/md/PrepareTOC.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.md; 2 | 3 | import java.io.File; 4 | import java.io.FileWriter; 5 | import java.io.IOException; 6 | 7 | public class PrepareTOC { 8 | public static void main(String [] argv) throws IOException { 9 | FileWriter output = new FileWriter("tableOfContents.sh"); 10 | output.write("#!/usr/bin/env bash\n\n"); 11 | File root = new File("."); 12 | for (File file : PreprocessMD.findAllPremdFiles()) { 13 | String relPath = file.getName(); 14 | while (!file.getParentFile().equals(root)) { 15 | file = file.getParentFile(); 16 | relPath = file.getName() + "/" + relPath; 17 | } 18 | output.write("./doc/script/gh-md-toc " + relPath 19 | + " &> " + relPath + ".toc\n"); 20 | } 21 | output.close(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/md/PreprocessMD.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.md; 2 | 3 | import java.io.File; 4 | import java.io.FileFilter; 5 | import java.io.IOException; 6 | import java.nio.file.Files; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class PreprocessMD { 11 | public static void main(String [] argv) throws IOException { 12 | for (File file : findAllPremdFiles()) { 13 | String cnt = new String(Files.readAllBytes(file.toPath())), result = ""; 14 | int pos; 15 | while ((pos = cnt.indexOf("<>", pos); 18 | String fn = cnt.substring(pos + 10, ePos); 19 | if (fn.equals("_TOC_")) { 20 | String tocCnt = new String(Files.readAllBytes( 21 | new File(file.getParent(), file.getName()+".toc").toPath())); 22 | pos = tocCnt.indexOf("Created by [gh-md-toc]"); 23 | if (pos != -1) { 24 | tocCnt = tocCnt.substring(0, pos).trim(); 25 | } 26 | result += tocCnt; 27 | } else { 28 | result += new String(Files.readAllBytes( 29 | new File(file.getParent(), fn).toPath())); 30 | } 31 | cnt = cnt.substring(ePos + 3); 32 | } 33 | result += cnt; 34 | Files.write(new File(file.getParent(), file.getName().replace(".pre.md", ".md")).toPath(), 35 | result.getBytes()); 36 | } 37 | } 38 | static List findAllPremdFiles() { 39 | return findFilesDeep(new File("."), new FileFilter() { 40 | @Override 41 | public boolean accept(File file) { 42 | return file.isDirectory() || file.getName().toLowerCase().endsWith(".pre.md"); 43 | } 44 | }); 45 | } 46 | private static List findFilesDeep(File root, FileFilter ff) { 47 | List listF = new ArrayList(); 48 | for (File file : root.listFiles(ff)) { 49 | if (file.isDirectory()) { 50 | listF.addAll(findFilesDeep(file, ff)); 51 | } else { 52 | listF.add(file); 53 | } 54 | } 55 | return listF; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/BlockPos.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api; 2 | 3 | public class BlockPos { 4 | private int x, y, z; 5 | 6 | public BlockPos(int x, int y, int z) { 7 | this.x = x; 8 | this.y = y; 9 | this.z = z; 10 | } 11 | 12 | public BlockPos(double x, double y, double z) { 13 | this((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z)); 14 | } 15 | 16 | public int getX() { 17 | return x; 18 | } 19 | 20 | public int getY() { 21 | return y; 22 | } 23 | 24 | public int getZ() { 25 | return z; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "(" + x + "," + y + "," + z + ")"; 31 | } 32 | public BlockPos add(int x, int y, int z) { 33 | return new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/BlocklyCatMarker.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api; 2 | 3 | public interface BlocklyCatMarker { 4 | 5 | static @interface I_PlayerLocation {} 6 | static @interface I_PlayerRotation {} 7 | static @interface I_BlockInfo {} 8 | static @interface I_GameStatus {} 9 | static @interface I_MovementState {} 10 | static @interface I_ClientStatus {} 11 | 12 | static @interface C_ControlKeys {} 13 | static @interface C_PlayerAttack {} 14 | static @interface C_ChangePlayerStatus {} 15 | static @interface C_BuildBlocks {} 16 | static @interface C_ChatPrint {} 17 | static @interface C_CommandAccess {} 18 | static @interface C_RenderUI {} 19 | static @interface C_ServerPacket {} 20 | // static @interface HelperUtils {} 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/BuildStepRecord.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api; 2 | 3 | public class BuildStepRecord { 4 | 5 | public PosInt blockPos; 6 | public Offset offset; 7 | public PlayerLoc playerLoc; 8 | public int placeDir; 9 | public int currentItem; 10 | public int facing; 11 | String itemName; 12 | public String blockAction = null; 13 | public float playerPitch; 14 | public float playerYaw; 15 | 16 | @Override 17 | public String toString() { 18 | return "blockPos:" + blockPos + "; placeDir:" + placeDir + "; playerLoc:" + playerLoc 19 | + "; currentItem:" + currentItem + "; playerPitch:" + playerPitch + "; playerYaw:" + playerYaw + "; offset:" + offset; 20 | } 21 | 22 | public static class PosInt { 23 | public int x; 24 | public int y; 25 | public int z; 26 | @Override 27 | public String toString() { 28 | return "(" + x + "," + y + "," + z + ")"; 29 | } 30 | } 31 | public static class PlayerLoc { 32 | public double x; 33 | public double y; 34 | public double z; 35 | @Override 36 | public String toString() { 37 | return "(" + x + "," + y + "," + z + ")"; 38 | } 39 | } 40 | 41 | public static class Offset { 42 | public float x; 43 | public float y; 44 | public float z; 45 | @Override 46 | public String toString() { 47 | return "(" + x + "," + y + "," + z + ")"; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/CommandInterface.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api; 2 | 3 | /** 4 | * Interface of command that only require a synchronous one time operation 5 | * 6 | * @author Minecraftkids 7 | * 8 | */ 9 | public interface CommandInterface { 10 | /** 11 | * Execute the synchronous one time operation 12 | * @param args command arguments 13 | */ 14 | void execute(String[] args); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/GameControl.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api; 2 | 3 | import com.logiccity.minecraft.api.BlocklyCatMarker.C_ChatPrint; 4 | import com.logiccity.minecraft.api.BlocklyCatMarker.C_CommandAccess; 5 | import com.logiccity.minecraft.api.BlocklyCatMarker.C_ControlKeys; 6 | import com.logiccity.minecraft.api.BlocklyCatMarker.C_PlayerAttack; 7 | import com.logiccity.minecraft.api.BlocklyCatMarker.C_RenderUI; 8 | import com.logiccity.minecraft.api.BlocklyCatMarker.C_ServerPacket; 9 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_BlockInfo; 10 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_ClientStatus; 11 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_GameStatus; 12 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_MovementState; 13 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_PlayerLocation; 14 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_PlayerRotation; 15 | 16 | /** 17 | * The interface for controlling the player or game states 18 | * 19 | * @author Minecraftkids 20 | * 21 | */ 22 | public interface GameControl { 23 | /** 24 | * Press or release the forward key 25 | * @param press 'true' for press; 'false' for release 26 | */ 27 | @C_ControlKeys 28 | void pressReleaseForwardKey(boolean press); 29 | /** 30 | * Press or release the backward key 31 | * @param press 'true' for press; 'false' for release 32 | */ 33 | @C_ControlKeys 34 | void pressReleaseBackKey(boolean press); 35 | /** 36 | * Press or release the left key 37 | * @param press 'true' for press; 'false' for release 38 | */ 39 | @C_ControlKeys 40 | void pressReleaseLeftKey(boolean press); 41 | /** 42 | * Press or release the right key 43 | * @param press 'true' for press; 'false' for release 44 | */ 45 | @C_ControlKeys 46 | void pressReleaseRightKey(boolean press); 47 | /** 48 | * Press or release the jump key 49 | * @param press 'true' for press; 'false' for release 50 | */ 51 | @C_ControlKeys 52 | void pressReleaseJumpKey(boolean press); 53 | /** 54 | * Press or release the sneak key 55 | * @param press 'true' for press; 'false' for release 56 | */ 57 | @C_ControlKeys 58 | void pressReleaseSneakKey(boolean press); 59 | /** 60 | * Press or release the sprint key 61 | * @param press 'true' for press; 'false' for release 62 | */ 63 | @C_ControlKeys 64 | void pressReleaseSprintKey(boolean press); 65 | /** 66 | * Press Release the attack key 67 | * @param press 'true' for press; 'false' for release 68 | */ 69 | @C_ControlKeys 70 | void pressReleaseAttackKey(boolean press); 71 | /** 72 | * Press and immediately release the jump key to make the player jump once 73 | */ 74 | @C_ControlKeys 75 | void playerJumpOnce(); 76 | /** 77 | * Prevent the normal mouse click event 78 | * @param prevent true to prevent event; false to restore the default 79 | */ 80 | @C_ControlKeys 81 | void setPreventClientClick(boolean prevent); 82 | 83 | /** 84 | * Send destroy block packet to the server 85 | * @param target the target block 86 | * @param facing the face of the block clicked 87 | */ 88 | @C_PlayerAttack 89 | void sendDestoryBlockAt(BlockPos target, int facing); 90 | /** 91 | * March toward and attack the named entity 92 | * @param chosenName entity name 93 | * @param waitMs the minimal wait time in milliseconds between consecutive attacks 94 | * @return target dead or can't be attacked 95 | */ 96 | @C_PlayerAttack 97 | boolean marchAttackEntity(String chosenName, int waitMs); 98 | /** 99 | * Make the player swing current holding item 100 | */ 101 | @C_PlayerAttack 102 | void playerSwingItem(); 103 | /** 104 | * Enable/Disable the knock back effect on the player 105 | * @param enabled false will disable knock back effect 106 | */ 107 | @C_PlayerAttack 108 | void setPlayerKnockBackEnabled(boolean enabled); 109 | /** 110 | * Initialize armor status UI 111 | * @param listMode armor list mode: 'horizontal' or 'vertical' 112 | * @param alignMode UI align mode: 'bottomLeft', 'bottomCenter', or 'bottomRight' 113 | * @param showPercent whether show damage as percentage 114 | * @param showMaxDamage whether to show max damage 115 | */ 116 | @C_PlayerAttack 117 | void initArmorStatusUI(String listMode, String alignMode, boolean showPercent, boolean showMaxDamage); 118 | /** 119 | * Calculate and set player yaw and pitch so the bow/arrow is point at a target 120 | * @param target intended target 121 | */ 122 | @C_PlayerAttack 123 | void pointArrowAt(String target); 124 | 125 | /** 126 | * Set the player's rotation pitch to a new value 127 | * @param pitch pitch 128 | */ 129 | @I_PlayerRotation 130 | void setRotationPitch(float pitch); 131 | /** 132 | * Set the player's rotation yaw to a new value 133 | * @param yaw yaw 134 | */ 135 | @I_PlayerRotation 136 | void setRotationYaw(float yaw); 137 | 138 | /** 139 | * Set if the player is on ground on the client side 140 | * @param onGround if on ground 141 | */ 142 | @I_PlayerLocation 143 | void setPlayerOnGround(boolean onGround); 144 | /** 145 | * Set the current player's x, y, z location on the client side 146 | * @param x new x location 147 | * @param y new y location 148 | * @param z new z location 149 | */ 150 | @I_PlayerLocation 151 | void setPlayerLocation(double x, double y, double z); 152 | 153 | /** 154 | * Execute a command 155 | * @param name the command name 156 | * @param args arguments to the command 157 | */ 158 | @C_CommandAccess 159 | void executeCommand(String name, String[] args); 160 | /** 161 | * Stop a command 162 | * @param name command name 163 | */ 164 | @C_CommandAccess 165 | void stopCommand(String name); 166 | 167 | /** 168 | * Send block placement packet to the server 169 | * @param x the x of the block being clicked 170 | * @param y the y of the block being clicked 171 | * @param z the z of the block being clicked 172 | * @param placeDir the clicked face of the block 173 | */ 174 | @I_BlockInfo 175 | void sendBlockPlacementPacket(int x, int y, int z, int placeDir); 176 | /** 177 | * Build one block based on the coordinates passed in 178 | * @param relativePos an integer array with relative x, y, z and an optional side face 179 | * @param yaw the yaw of player 180 | * @param x x offset 181 | * @param y y offset 182 | * @param z z offset 183 | */ 184 | @I_BlockInfo 185 | void buildOneBlock(int[] relativePos, float yaw, double x, double y, double z); 186 | 187 | /** 188 | * Start to record player's block placements/destructions 189 | * @param name the name used to identify the recorded steps 190 | */ 191 | // @HelperUtils 192 | void recordBuildingSteps(String name); 193 | /** 194 | * Start to record all player activities 195 | * @param name the name used to identify the recorded activities 196 | */ 197 | // @HelperUtils 198 | void recordAllSteps(String name); 199 | /** 200 | * Stop the current recording 201 | */ 202 | // @HelperUtils 203 | void stopRecordSteps(); 204 | 205 | /** 206 | * Send error level message to the chat log 207 | * @param msg error message 208 | */ 209 | @C_ChatPrint 210 | void chatLogError(String msg); 211 | /** 212 | * Send warning level message to the chat log 213 | * @param msg warning message 214 | */ 215 | @C_ChatPrint 216 | void chatLogWarning(String msg); 217 | /** 218 | * Send info level message to the chat log 219 | * @param msg info message 220 | */ 221 | @C_ChatPrint 222 | void chatLogInfo(String msg); 223 | /** 224 | * Send raw log to chat 225 | * @param msg message 226 | */ 227 | @C_ChatPrint 228 | void chatLogRaw(String msg); 229 | 230 | /** 231 | * Set the player's Y motion 232 | * @param my new Y motion 233 | */ 234 | @I_MovementState 235 | void setPlayerMotionY(double my); 236 | /** 237 | * Clear player's XZ motion so it will stop moving 238 | */ 239 | @I_MovementState 240 | void clearPlayerMotionXZ(); 241 | /** 242 | * Set the sprinting state of the player 243 | * @param sprinting sprinting on or off 244 | */ 245 | @I_MovementState 246 | void setPlayerSprinting(boolean sprinting); 247 | /** 248 | * Set the player fall distance on the client side 249 | * @param f fall distance 250 | */ 251 | @I_MovementState 252 | void setPlayerFallDistance(float f); 253 | 254 | /** 255 | * Set the players current holding item 256 | * @param index the index of target item 257 | * @return true if the current holding item was changed 258 | */ 259 | @I_ClientStatus 260 | boolean setPlayerCurrentItem(int index); 261 | /** 262 | * Set the factor that determines how far the player will move each tick if it is jumping or falling 263 | * @param f the factor which is 0.02 by default 264 | */ 265 | @I_ClientStatus 266 | void setJumpMovementFactor(float f); 267 | /** 268 | * Clear the player's InWeb status 269 | */ 270 | @I_ClientStatus 271 | void setPlayerNotInWeb(); 272 | 273 | /** 274 | * Set the brightness level of the world 275 | * @param gamma brightness level 276 | */ 277 | @I_GameStatus 278 | void setWorldBrightness(float gamma); 279 | /** 280 | * Update Base Finder render blocks such as wood, rail, fence and etc 281 | */ 282 | @I_GameStatus 283 | void baseFinderUpdate(); 284 | /** 285 | * Clone a fake player with an Id in client world 286 | * @param id the id of fake player 287 | */ 288 | @I_GameStatus 289 | void cloneFakePlayer(int id); 290 | /** 291 | * Remove an entity from the client world 292 | * @param id the id of the entity 293 | */ 294 | @I_GameStatus 295 | void removeEntityAndRenderWorld(int id); 296 | 297 | /** 298 | * Highlight an entity in render thread 299 | * @param entityName name of the entity 300 | * @param colorMode 0: Enemy; 1: Target; 2: Other; 3: Friend; 4: Team 301 | */ 302 | @C_RenderUI 303 | void renderHighlightEntity(String entityName, int colorMode); 304 | /** 305 | * Highlight all invisible living entities 306 | */ 307 | @C_RenderUI 308 | void renderInvisibleLivingEntities(); 309 | /** 310 | * Render tracers to all loaded players 311 | */ 312 | @C_RenderUI 313 | void renderPlayerTracers(); 314 | /** 315 | * Render highlight of chests in the game 316 | * @param maxChests the limit on number of positions returned 317 | * @return if maximum limit reached 318 | */ 319 | @C_RenderUI 320 | boolean renderChestEsp(int maxChests); 321 | /** 322 | * Refresh all UI renderers 323 | */ 324 | @C_RenderUI 325 | void refreshRenderers(); 326 | /** 327 | * Set the size of name above the heads of entities 328 | * @param size the size. Default: 1 329 | */ 330 | @C_RenderUI 331 | void setPlayerLabelScale(float size); 332 | /** 333 | * Render armor status of the player. Called in render thread 334 | */ 335 | @C_RenderUI 336 | void renderPlayerArmorStatus(); 337 | /** 338 | * Initialize Base Finder limits 339 | * @param maxBlocks max artificial blocks to be rendered 340 | * @param range max range of blocks 341 | */ 342 | @C_RenderUI 343 | void initBaseFinder(int maxBlocks, int range); 344 | /** 345 | * Render artificial blocks in Base Finder 346 | */ 347 | @C_RenderUI 348 | void baseFinderRender(); 349 | 350 | /** 351 | * Stop sending certain packages to the Minecraft server 352 | * @param types comma separated list of: '1': Attack/Release/Dig; '2': Placement; '3': All others 353 | */ 354 | @C_ServerPacket 355 | void stopSendingPackagesToServer(String types); 356 | /** 357 | * Send packet to simulate the pressing UseItem (mouse key) action by the current user 358 | */ 359 | @C_ServerPacket 360 | void simulateUseItemKeyPress(); 361 | /** 362 | * Send packet to simulate the releasing UseItem (mouse key) action by the current user 363 | */ 364 | @C_ServerPacket 365 | void simulateUseItemKeyRelease(); 366 | /** 367 | * Send a packet to server to simulate a time unit has passed 368 | */ 369 | @C_ServerPacket 370 | void simulateTimeUnitPassed(); 371 | /** 372 | * Send a packet to server to indicate player position 373 | * @param posX player x 374 | * @param posY player y 375 | * @param posZ player z 376 | * @param isOnGround if the player is on the ground 377 | */ 378 | @C_ServerPacket 379 | void sendPlayerPositionPacketToServer(double posX, double posY, double posZ, boolean isOnGround); 380 | /** 381 | * Send fake packet to server to indicate on ground status if the player is falling 382 | */ 383 | @C_ServerPacket 384 | void sendFakeOnGroundPackageIfFalling(); 385 | /** 386 | * Send packets to server to face an entity and attack it. 387 | * @param en the name of the entity 388 | */ 389 | @C_ServerPacket 390 | void sendFaceEntityAttackPackets(String en); 391 | /** 392 | * Send packet to server in start or stop sneaking 393 | * @param start true for start; false for stop 394 | */ 395 | @C_ServerPacket 396 | void sendSneakingStartStopPacket(boolean start); 397 | } 398 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/GameInfo.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.logiccity.minecraft.api.BlocklyCatMarker.C_CommandAccess; 7 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_BlockInfo; 8 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_ClientStatus; 9 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_GameStatus; 10 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_MovementState; 11 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_PlayerLocation; 12 | import com.logiccity.minecraft.api.BlocklyCatMarker.I_PlayerRotation; 13 | 14 | /** 15 | * The interface for retrieving player/game info 16 | * @author Minecraftkids 17 | * 18 | */ 19 | public interface GameInfo { 20 | /** 21 | * Get player x coordinate 22 | * @return x 23 | */ 24 | @I_PlayerLocation 25 | double getPlayerPosX(); 26 | /** 27 | * Get player y coordinate 28 | * @return y 29 | */ 30 | @I_PlayerLocation 31 | double getPlayerPosY(); 32 | /** 33 | * Get player z coordinate 34 | * @return z 35 | */ 36 | @I_PlayerLocation 37 | double getPlayerPosZ(); 38 | /** 39 | * Get block location of an living entity 40 | * @param name entity name or unique ID. null or empty string means current player 41 | * @return block position 42 | */ 43 | @I_PlayerLocation 44 | BlockPos getLivingEntityLocation(String name); 45 | /** 46 | * Get the square distance form the player to a point 47 | * @param x the point's x coordinate 48 | * @param y the point's y coordinate 49 | * @param z the point's z coordinate 50 | * @return the square distance 51 | */ 52 | @I_PlayerLocation 53 | double getPlayerDistanceSq(double x, double y, double z); 54 | /** 55 | * Get player mouse over block pos 56 | * @return block pos 57 | */ 58 | @I_PlayerLocation 59 | BlockPos getMouseOverBlock(); 60 | /** 61 | * If the player is on the ground 62 | * @return if the player is on the ground 63 | */ 64 | @I_PlayerLocation 65 | boolean isPlayerOnGround(); 66 | 67 | /** 68 | * Get player's rotation yaw 69 | * @return yaw 70 | */ 71 | @I_PlayerRotation 72 | float getRotationYaw(); 73 | /** 74 | * Get player's rotation pitch 75 | * @return pitch 76 | */ 77 | @I_PlayerRotation 78 | float getRotationPitch(); 79 | /** 80 | * Get player's rotation yaw at the previous tic 81 | * @return yaw 82 | */ 83 | @I_PlayerRotation 84 | float getPreviousRotationYaw(); 85 | /** 86 | * Get player's rotation pitch at the previous tic 87 | * @return pitch 88 | */ 89 | @I_PlayerRotation 90 | float getPreviousRotationPitch(); 91 | /** 92 | * The distance between the projected block that another player is directly facing and the current player 93 | * @param playerName the other player's name 94 | * @return the [yaw, pitch] distances in blocks 95 | */ 96 | @I_PlayerRotation 97 | float[] lookAtMeDelta(String playerName); 98 | /** 99 | * The calculated yaw for the player to face a block horizontally 100 | * @param bp the position of a block 101 | * @return the calculated yaw to face the block 102 | */ 103 | @I_PlayerRotation 104 | float faceBlockYaw(BlockPos bp); 105 | 106 | /** 107 | * Check if the player is flying 108 | * @return true if flying 109 | */ 110 | @I_MovementState 111 | boolean isPlayerFlying(); 112 | /** 113 | * Check if the player collided horizontally 114 | * @return true if player has collided with something on X- or Z-axis 115 | */ 116 | @I_MovementState 117 | boolean isPlayerCollidedHorizontally(); 118 | /** 119 | * Check if the player is changing location 120 | * @return true if player is changing location 121 | */ 122 | @I_MovementState 123 | boolean isPlayerChaningLocation(); 124 | /** 125 | * Get the speed that the player is moving forward 126 | * @return the speed that player is moving forward(positive) or backward(negative) 127 | */ 128 | @I_MovementState 129 | float getPlayerForwardSpeed(); 130 | /** 131 | * Get the vertical motion of the current player 132 | * @return the vertical motion 133 | */ 134 | @I_MovementState 135 | double getPlayerMotionY(); 136 | 137 | /** 138 | * Check if the Sneaking key is pressed 139 | * @return if the player is sneaking 140 | */ 141 | @I_ClientStatus 142 | boolean isKeySneakPressed(); 143 | /** 144 | * Check if the UseItem key (mouse key) is pressed 145 | * @return if the UseItem key is pressed 146 | */ 147 | @I_ClientStatus 148 | boolean isKeyUseItemPressed(); 149 | /** 150 | * Check if the Attack key (mouse key) is pressed 151 | * @return if the Attack key is pressed 152 | */ 153 | @I_ClientStatus 154 | boolean isKeyAttackPressed(); 155 | /** 156 | * Check if the jump key is pressed 157 | * @return if the jump key pressed 158 | */ 159 | @I_ClientStatus 160 | boolean isKeyJumpPressed(); 161 | /** 162 | * Get the item unlocalized name that a player is holding 163 | * @param playerName A player's name, use null or empty string for the current user 164 | * @return item's unlocalized name 165 | */ 166 | @I_ClientStatus 167 | String holdingItemUnlocalizedName(String playerName); 168 | 169 | /** 170 | * Get the names of entities that are closest to the player 171 | * @param count the number of names to return 172 | * @param playerOnly if only players are included 173 | * @return list of names 174 | */ 175 | @I_GameStatus 176 | List getClosestEntityNames(int count, boolean playerOnly); 177 | /** 178 | * Check if the current game mode is creative 179 | * @return true if in creative mode 180 | */ 181 | @I_GameStatus 182 | boolean isCreativeMode(); 183 | 184 | /** 185 | * Check if the material on a block is solid 186 | * @param pos the block position 187 | * @return true if solid 188 | */ 189 | @I_BlockInfo 190 | boolean isSolid(BlockPos pos); 191 | /** 192 | * Check if a block is safe to walk on 193 | * @param pos block position 194 | * @return true if safe 195 | */ 196 | @I_BlockInfo 197 | boolean isSafeWalkOn(BlockPos pos); 198 | /** 199 | * Check if a block material is ladder 200 | * @param pos block position 201 | * @return true if ladder 202 | */ 203 | @I_BlockInfo 204 | boolean isLadder(BlockPos pos); 205 | /** 206 | * Check if a block is in water 207 | * @param pos block position 208 | * @return true if in water 209 | */ 210 | @I_BlockInfo 211 | boolean isInWater(BlockPos pos); 212 | 213 | /** 214 | * Check if the named command is running 215 | * @param name command name 216 | * @return true if command is running 217 | */ 218 | @C_CommandAccess 219 | boolean isCommandRunning(String name); 220 | /** 221 | * Check if any other command is running 222 | * @param excludes comma separated command names to be excluded from checking 223 | * @return true if any other command is running 224 | */ 225 | boolean isAnyCommandRunning(String excludes); 226 | 227 | /** 228 | * Load previously recorded building steps 229 | * @param name the name of the recording 230 | * @return a ArrayList of steps 231 | */ 232 | // @I_HelperUtils 233 | ArrayList loadRecordedBuildingSteps(String name); 234 | /** 235 | * Generated a random 2-D maze 236 | * @param columns the number of path ways in each row 237 | * @param rows the number of path ways in each column 238 | * @return a 2-D boolean array with true as wall blocks 239 | */ 240 | // @I_HelperUtils 241 | boolean [][] generateMaze(int columns, int rows); 242 | 243 | /** 244 | * Get health of a living entity 245 | * @param name the name of the entity 246 | * @return the health number or -1 if entity died or does not exist 247 | */ 248 | @I_GameStatus 249 | float getLivingEntityHealth(String name); 250 | /** 251 | * Get the entity with the smallest angle to the direction the player is facing 252 | * @return names for players or unique ID for non-players 253 | */ 254 | @I_GameStatus 255 | String getClosestFacingAngleEntity(); 256 | 257 | /** 258 | * Get the current brightness level of the world 259 | * @return the brightness level 260 | */ 261 | @I_GameStatus 262 | float getWorldBrightness(); 263 | } 264 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/ModCommandInterface.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api; 2 | 3 | /** 4 | * The interface for commands that requires continuously running asynchronous operations in 5 | * update or render tic threads until certain conditions are met 6 | * @author Minecraftkids 7 | * 8 | */ 9 | public interface ModCommandInterface { 10 | /** 11 | * Initialize the command 12 | * @param args command arguments 13 | */ 14 | void initCmd(String[] args); 15 | /** 16 | * Cleanup the command 17 | */ 18 | public void cleanupCmd(); 19 | /** 20 | * Add a command to a list of commands that will be synchronously executed before next update invocation 21 | * @param cmdName the name of the command 22 | * @param args comma or space separated list of arguments 23 | */ 24 | void addToSyncCmds(String cmdName, String args); 25 | /** 26 | * Invoke operations in the game tick thread which runs every few milliseconds 27 | * @return true will cause the command to be stopped, false will cause the command to continue 28 | */ 29 | boolean doInUpdateTicThread(); 30 | /** 31 | * Perform main UI rendering in the game tick thread which runs every few milliseconds 32 | * @return true will cause the command to be stopped, false will cause the command to continue 33 | */ 34 | boolean doInRenderTicThread(); 35 | /** 36 | * Perform additional rendering on top of the main rendering. Overwrite content below. 37 | * @return true will cause the command to be stopped, false will cause the command to continue 38 | */ 39 | boolean doInPostInGameRenderTicThread(); 40 | /** 41 | * Configure this command based on user input from on the chat line. All command configuration 42 | * chat inputs start with "/-" 43 | * @param input the string after "/-" 44 | * @return true will cause the command to be stopped, false will cause the command to continue 45 | */ 46 | boolean doInCmdInputThread(String input); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/AntiAFK.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/AntiAFK.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/AntiKB.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/AntiKB.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/ArmorStatus.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.demo; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class ArmorStatus extends CustomModCommandBase { 6 | private ArmorStatus() { 7 | super("ArmorStatus", 0, 1, 2, 3, 4); 8 | } 9 | 10 | @Override 11 | public void initCmd(String[] args) { 12 | String listMode = "vertical", alignMode = "bottomleft"; 13 | boolean showPercent = false, showMaxDamage = true; 14 | if (args != null && args.length > 0) { 15 | listMode = args[0]; 16 | if (args.length > 1) { 17 | alignMode = args[1]; 18 | if (args.length > 2) { 19 | showPercent = Boolean.valueOf(args[2]); 20 | if (args.length > 3) { 21 | showMaxDamage = Boolean.valueOf(args[3]); 22 | } 23 | } 24 | } 25 | } 26 | gameControl.initArmorStatusUI(listMode, alignMode, showPercent, showMaxDamage); 27 | } 28 | 29 | @Override 30 | public boolean doInPostInGameRenderTicThread() { 31 | gameControl.renderPlayerArmorStatus(); 32 | return false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/AutoSprint.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/AutoSprint.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/BaseFinder.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.demo; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class BaseFinder extends CustomModCommandBase { 6 | private BaseFinder() { 7 | super("BaseFinder", "H", 0, 1, 2); 8 | } 9 | 10 | @Override 11 | public void initCmd(String[] args) { 12 | if (args != null && args.length > 0) { 13 | int maxBlocks = Integer.parseInt(args[0]); 14 | if (args.length > 1) { 15 | gameControl.initBaseFinder(maxBlocks, Integer.parseInt(args[1])); 16 | } else { 17 | gameControl.initBaseFinder(maxBlocks, 50); 18 | } 19 | } 20 | } 21 | 22 | @Override 23 | public boolean doInRenderTicThread() { 24 | gameControl.baseFinderRender(); 25 | return false; 26 | } 27 | 28 | @Override 29 | public boolean doInUpdateTicThread() { 30 | if (this.hasMillisPassed(3000)) { 31 | gameControl.baseFinderUpdate(); 32 | } 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/ChestESP.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/ChestESP.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/Criticals.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/Criticals.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/Flight.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.demo; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class Flight extends CustomModCommandBase { 6 | private Flight() { 7 | super("Flight", "F"); 8 | } 9 | 10 | @Override 11 | public void initCmd(String[] args) { 12 | // gameControl.executeCommand("NoFall", null); 13 | } 14 | 15 | @Override 16 | public boolean doInUpdateTicThread() { 17 | if (!gameInfo.isPlayerOnGround()) { 18 | if (gameInfo.isKeyJumpPressed()) { 19 | gameControl.setPlayerMotionY(0.2); 20 | } else if (gameInfo.isKeySneakPressed()){ 21 | gameControl.setPlayerMotionY(-0.2); 22 | } else { 23 | gameControl.setPlayerMotionY(-0.02); 24 | } 25 | } 26 | return false; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/Freecam.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/Freecam.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/Fullbright.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/Fullbright.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/KillAura.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/KillAura.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/NameTags.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/NameTags.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/NoFall.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/NoFall.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/NoWeb.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/NoWeb.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/ProphuntEsp.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.demo; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class ProphuntEsp extends CustomModCommandBase { 6 | private ProphuntEsp() { 7 | super("ProphuntEsp", "K"); 8 | } 9 | 10 | @Override 11 | public boolean doInRenderTicThread() { 12 | gameControl.renderInvisibleLivingEntities(); 13 | return false; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/Sneak.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/Sneak.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/SpeedMine.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/SpeedMine.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/Tracer.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/Tracer.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/demo/Xray.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/demo/Xray.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/Attack.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import java.util.List; 4 | 5 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 6 | 7 | public class Attack extends CustomModCommandBase { 8 | private static final int CLOSE_CNT = 5; 9 | private String chosenName = null; 10 | List closeEntityNames = null; 11 | private Attack() { 12 | super("attack"); 13 | } 14 | 15 | @Override 16 | public void initCmd(String [] args) { 17 | chosenName = null; 18 | closeEntityNames = gameInfo.getClosestEntityNames(CLOSE_CNT, false); 19 | String msg = "Choose target: "; 20 | int i = 1; 21 | for (String name : closeEntityNames) { 22 | msg += (i ++) + "(" + name + "), "; 23 | } 24 | gameControl.chatLogInfo(msg); 25 | } 26 | @Override 27 | public void cleanupCmd() { 28 | gameControl.pressReleaseForwardKey(false);; 29 | } 30 | 31 | @Override 32 | protected boolean handleCmdInput(String input) { 33 | try { 34 | int index = Integer.parseInt(input) - 1; 35 | if (index > -1 && index < CLOSE_CNT) { 36 | chosenName = closeEntityNames.get(index); 37 | } 38 | } catch (Exception e) { 39 | // ignore error inputs 40 | } 41 | if (chosenName == null) { 42 | return true; 43 | } 44 | return false; 45 | } 46 | 47 | @Override 48 | public boolean doInUpdateTicThread() { 49 | if (chosenName == null) { 50 | return false; 51 | } 52 | return gameControl.marchAttackEntity(chosenName, 200); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/BowAim.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class BowAim extends CustomModCommandBase { 6 | private BowAim() { 7 | super("AutoBow", "Y"); 8 | } 9 | 10 | private String target = null, tmpTarget = null; 11 | private float velocity; 12 | 13 | @Override 14 | public boolean doInRenderTicThread() { 15 | if (tmpTarget != null) { 16 | gameControl.renderHighlightEntity(tmpTarget, 1); 17 | } 18 | return false; 19 | } 20 | 21 | @Override 22 | public void cleanupCmd() { 23 | target = tmpTarget = null; 24 | gameControl.setPreventClientClick(false); 25 | gameControl.stopSendingPackagesToServer(null); 26 | } 27 | 28 | @Override 29 | public boolean doInUpdateTicThread() { 30 | if ("bow".equals(gameInfo.holdingItemUnlocalizedName(null))) { 31 | if (gameInfo.isKeyUseItemPressed()) { 32 | gameControl.stopSendingPackagesToServer("1"); 33 | tmpTarget = gameInfo.getClosestFacingAngleEntity(); 34 | return false; 35 | } 36 | gameControl.stopSendingPackagesToServer(null); 37 | gameControl.setPreventClientClick(true); 38 | if (tmpTarget != null) { 39 | target = tmpTarget; 40 | } else { 41 | target = tmpTarget = null; 42 | return false; 43 | } 44 | if (gameInfo.getLivingEntityHealth(target) <= 0) { 45 | target = tmpTarget = null; 46 | return false; 47 | } 48 | 49 | aimAtTarget(); 50 | 51 | if (gameInfo.isKeyAttackPressed()) { 52 | fireArrow(); 53 | gameControl.setPreventClientClick(false); 54 | } 55 | // fireArrow(); 56 | } else { 57 | target = tmpTarget = null; 58 | } 59 | return false; 60 | } 61 | 62 | private final void fireArrow() { 63 | if ((! "bow".equals(gameInfo.holdingItemUnlocalizedName(null))) 64 | || target == null || gameInfo.getLivingEntityHealth(target) <= 0) { 65 | target = tmpTarget = null; 66 | return; 67 | } 68 | gameControl.simulateUseItemKeyPress(); 69 | for (int i = 0; i < 20; i++) { 70 | gameControl.simulateTimeUnitPassed(); 71 | } 72 | gameControl.simulateUseItemKeyRelease(); 73 | } 74 | 75 | private void aimAtTarget() { 76 | if (target == null) { 77 | return; 78 | } 79 | gameControl.pointArrowAt(target); 80 | } 81 | 82 | @Override 83 | protected boolean handleCmdInput(String input) { 84 | if (this.getKeyChar()== input.charAt(0)) { 85 | fireArrow(); 86 | return false; 87 | } else { 88 | return super.handleCmdInput(input); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/BowEscape.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class BowEscape extends CustomModCommandBase { 6 | private String playerName; 7 | 8 | private BowEscape() { 9 | super("bowEscape", 1); 10 | } 11 | 12 | @Override 13 | public void initCmd(String [] args) { 14 | playerName = args[0]; 15 | } 16 | 17 | @Override 18 | public boolean doInUpdateTicThread() { 19 | if (this.hasMillisPassed(500)) { 20 | if ("bow".equals(gameInfo.holdingItemUnlocalizedName(playerName))) { 21 | float[] delta = gameInfo.lookAtMeDelta(playerName); 22 | if (delta != null) { 23 | // System.out.println(delta[0] + "," + delta[1]); 24 | if (delta[0] < 5 && delta[1] < 1) { 25 | gameControl.pressReleaseLeftKey(true); 26 | gameControl.pressReleaseSprintKey(true); 27 | return false; 28 | } 29 | } 30 | gameControl.pressReleaseLeftKey(false); 31 | gameControl.pressReleaseSprintKey(false); 32 | } 33 | } 34 | return false; 35 | } 36 | 37 | @Override 38 | public void cleanupCmd() { 39 | gameControl.pressReleaseLeftKey(false); 40 | gameControl.pressReleaseSprintKey(false); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/Coords.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/staging/Coords.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/FastMaze.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.command.trial.BuildMaze; 4 | 5 | public class FastMaze extends BuildMaze { 6 | protected FastMaze() { 7 | super("fastMaze"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/GoBack.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class GoBack extends CustomModCommandBase { 6 | private GoBack() { 7 | super("goB", 1); 8 | } 9 | 10 | double dist , startX, startY, startZ; 11 | 12 | @Override 13 | public void initCmd(String [] args) { 14 | dist = Double.parseDouble(args[0]); 15 | startX = gameInfo.getPlayerPosX(); 16 | startY = gameInfo.getPlayerPosY(); 17 | startZ = gameInfo.getPlayerPosZ(); 18 | dist = dist * dist; 19 | } 20 | 21 | @Override 22 | public boolean doInUpdateTicThread() { 23 | if (gameInfo.getPlayerDistanceSq(startX, 24 | startY, startZ) < dist) { 25 | gameControl.pressReleaseBackKey(true); 26 | return false; 27 | } 28 | gameControl.pressReleaseBackKey(false); 29 | return true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/GoForward.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class GoForward extends CustomModCommandBase { 6 | 7 | private GoForward() { 8 | super("goF", 1); 9 | } 10 | 11 | double dist , startX, startY, startZ; 12 | 13 | @Override 14 | public void initCmd(String [] args) { 15 | dist = Double.parseDouble(args[0]); 16 | startX = gameInfo.getPlayerPosX(); 17 | startY = gameInfo.getPlayerPosY(); 18 | startZ = gameInfo.getPlayerPosZ(); 19 | dist = dist * dist; 20 | } 21 | 22 | @Override 23 | public boolean doInUpdateTicThread() { 24 | if (gameInfo.getPlayerDistanceSq(startX, 25 | startY, startZ) < dist) { 26 | gameControl.pressReleaseForwardKey(true); 27 | return false; 28 | } 29 | gameControl.pressReleaseForwardKey(false); 30 | return true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/GoLeft.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class GoLeft extends CustomModCommandBase { 6 | private GoLeft() { 7 | super("goL", 1); 8 | } 9 | 10 | double dist , startX, startY, startZ; 11 | 12 | @Override 13 | public void initCmd(String [] args) { 14 | dist = Double.parseDouble(args[0]); 15 | startX = gameInfo.getPlayerPosX(); 16 | startY = gameInfo.getPlayerPosY(); 17 | startZ = gameInfo.getPlayerPosZ(); 18 | dist = dist * dist; 19 | } 20 | 21 | @Override 22 | public boolean doInUpdateTicThread() { 23 | if (gameInfo.getPlayerDistanceSq(startX, 24 | startY, startZ) < dist) { 25 | gameControl.pressReleaseLeftKey(true); 26 | return false; 27 | } 28 | gameControl.pressReleaseLeftKey(false); 29 | return true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/GoRight.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | 5 | public class GoRight extends CustomModCommandBase { 6 | private GoRight() { 7 | super("goR", 1); 8 | } 9 | 10 | double dist , startX, startY, startZ; 11 | 12 | @Override 13 | public void initCmd(String [] args) { 14 | dist = Double.parseDouble(args[0]); 15 | startX = gameInfo.getPlayerPosX(); 16 | startY = gameInfo.getPlayerPosY(); 17 | startZ = gameInfo.getPlayerPosZ(); 18 | dist = dist * dist; 19 | } 20 | 21 | @Override 22 | public boolean doInUpdateTicThread() { 23 | if (gameInfo.getPlayerDistanceSq(startX, 24 | startY, startZ) < dist) { 25 | gameControl.pressReleaseRightKey(true); 26 | return false; 27 | } 28 | gameControl.pressReleaseRightKey(false); 29 | return true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/GoToCmd.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import java.util.ArrayList; 4 | 5 | import com.logiccity.minecraft.api.BlockPos; 6 | import com.logiccity.minecraft.api.GameControl; 7 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 8 | import com.logiccity.minecraft.api.util.PathFinder; 9 | import com.logiccity.minecraft.api.util.PathUtils; 10 | 11 | public class GoToCmd extends CustomModCommandBase { 12 | private BlockCenterFlags blockCenterFlags = new BlockCenterFlags(); 13 | private GoToCmd() { 14 | super("goto", 3); 15 | } 16 | 17 | private ArrayList path; 18 | private int index, yawI; 19 | 20 | private boolean sneaking = false; 21 | 22 | @Override 23 | public void initCmd(String[] args) 24 | { 25 | double[] pos = new double[] { Double.parseDouble(args[0]), 26 | Double.parseDouble(args[1]), Double.parseDouble(args[2]) }; 27 | if (Math.abs(pos[0] - gameInfo.getPlayerPosX()) > 256 28 | || Math.abs(pos[2] - gameInfo.getPlayerPosZ()) > 256) { 29 | gameControl.chatLogError("Goal is out of range! Maximum range is 256 blocks."); 30 | path = null; 31 | return; 32 | } 33 | index = 0; 34 | BlockPos goal = new BlockPos(pos[0], pos[1], pos[2]); 35 | if (PathUtils.isSafe(goal, gameInfo)) { 36 | PathFinder pathFinder = new PathFinder(gameInfo, goal); 37 | if (pathFinder.find()) { 38 | path = pathFinder.formatPath(); 39 | System.out.println("found path: " + path); 40 | if (path.size() > 0) { 41 | yawI = Turn.getAxisesYaw(gameInfo.getRotationYaw()); 42 | gameControl.executeCommand("turn", new String [] { String.valueOf(yawI) }); 43 | 44 | resetControls(gameControl); 45 | setBlockCenterFlags(); 46 | } 47 | return; 48 | } 49 | } 50 | path = null; 51 | gameControl.chatLogError("Could not find a path."); 52 | } 53 | 54 | private void setBlockCenterFlags() { 55 | double dx = Math.floor(gameInfo.getPlayerPosX()) + 0.5 - gameInfo.getPlayerPosX(); 56 | double dz = Math.floor(gameInfo.getPlayerPosZ()) + 0.5 - gameInfo.getPlayerPosZ(); 57 | if (dx > 0) { 58 | blockCenterFlags.px = true; 59 | } else if (dx < 0) { 60 | blockCenterFlags.nx = true; 61 | } 62 | if (dz > 0) { 63 | blockCenterFlags.pz = true; 64 | } else if (dz < 0) { 65 | blockCenterFlags.nz = true; 66 | } 67 | } 68 | 69 | @Override 70 | public void cleanupCmd() 71 | { 72 | path = null; 73 | resetControls(gameControl); 74 | } 75 | 76 | public static final void resetControls(GameControl gc) { 77 | gc.pressReleaseForwardKey(false); 78 | gc.pressReleaseBackKey(false); 79 | gc.pressReleaseRightKey(false); 80 | gc.pressReleaseLeftKey(false); 81 | gc.pressReleaseJumpKey(false); 82 | gc.pressReleaseSneakKey(false); 83 | } 84 | 85 | @Override 86 | public boolean doInUpdateTicThread() { 87 | if(path == null || path.isEmpty()) 88 | { 89 | return true; 90 | } 91 | resetControls(gameControl); 92 | if (gameInfo.isCommandRunning("turn")) { 93 | return false; 94 | } 95 | if (Math.abs(gameInfo.getRotationYaw() - yawI) > 0.1 ) { 96 | gameControl.executeCommand("turn", new String [] { String.valueOf(yawI) }); 97 | return false; 98 | } 99 | BlockPos currentPos = gameInfo.getLivingEntityLocation(null); 100 | if ((! sneaking) && blockCenterFlags.needCenter()) { 101 | double dxB = currentPos.getX() + 0.5 - gameInfo.getPlayerPosX(), 102 | dzB = currentPos.getZ() + 0.5 - gameInfo.getPlayerPosZ(); 103 | //System.out.println("---:Loc: (" + player.posX + "," + player.posZ + ")"); 104 | //System.out.println("---:Delta: (" + dxB + "," + dzB + ")"); 105 | 106 | if(blockCenterFlags.px) { 107 | if (dxB > 0) { 108 | movePlayerX(gameControl, true, yawI); 109 | } else { 110 | gameControl.clearPlayerMotionXZ(); 111 | blockCenterFlags.px = false; 112 | } 113 | } else if (blockCenterFlags.nx) { 114 | if(dxB < 0) { 115 | movePlayerX(gameControl, false, yawI); 116 | } else { 117 | gameControl.clearPlayerMotionXZ(); 118 | blockCenterFlags.nx = false; 119 | } 120 | } 121 | if (blockCenterFlags.pz) { 122 | if (dzB > 0) { 123 | movePlayerZ(gameControl, true, yawI); 124 | } else { 125 | gameControl.clearPlayerMotionXZ(); 126 | blockCenterFlags.pz = false; 127 | } 128 | } else if (blockCenterFlags.nz) { 129 | if (dzB < 0) { 130 | movePlayerZ(gameControl, false, yawI); 131 | } else { 132 | gameControl.clearPlayerMotionXZ(); 133 | blockCenterFlags.nz = false; 134 | } 135 | } 136 | // Minecraft.getMinecraft().gameSettings.keyBindSneak.pressed = sneaking; 137 | return false; 138 | } 139 | BlockPos nextPos = path.get(index); 140 | while (gameInfo.isSolid(nextPos)) { 141 | nextPos = nextPos.add(0, 1, 0); 142 | } 143 | sneaking = nextPos.getY() == ((int) Math.floor(gameInfo.getPlayerPosY())) && (! gameInfo.isSolid(nextPos.add(0, -1, 0))); 144 | if (sneaking) { 145 | gameControl.pressReleaseSneakKey(true); 146 | } else { 147 | gameControl.pressReleaseSneakKey(false); 148 | } 149 | int dx = nextPos.getX() - currentPos.getX(), dy = nextPos.getY() - currentPos.getY(), 150 | dz = nextPos.getZ() - currentPos.getZ(); 151 | 152 | // System.out.println("---currentPos:" + currentPos); 153 | // System.out.println("---nextPos:" + nextPos); 154 | // System.out.println("---dx:" + dx + ";dy:" + dy + ";dz:" + dz); 155 | if (dy > 0) { 156 | gameControl.pressReleaseJumpKey(true); 157 | // } else if (dy < 0) { 158 | // if(PathUtils.isFlyable(currentPos)) { 159 | // Minecraft.getMinecraft().gameSettings.keyBindSneak.pressed = true; 160 | // } 161 | } 162 | // jumpOverObstacle(currentPos, dx, dz); 163 | if(dx > 0) { 164 | movePlayerX(gameControl, true, yawI); 165 | } else if (dx < 0) { 166 | movePlayerX(gameControl, false, yawI); 167 | } 168 | if (dz > 0) { 169 | movePlayerZ(gameControl, true, yawI); 170 | } else if (dz < 0) { 171 | movePlayerZ(gameControl, false, yawI); 172 | } 173 | if (dx == 0 && dz == 0) { 174 | index++; 175 | resetControls(gameControl); 176 | if(index >= path.size()) { 177 | return true; 178 | } 179 | setBlockCenterFlags(); 180 | return false; 181 | } 182 | return false; 183 | } 184 | 185 | private static class BlockCenterFlags { 186 | boolean pz = false, nz = false, px = false, nx = false; 187 | 188 | void reset() { 189 | pz = nz = px = nx = false; 190 | } 191 | 192 | boolean needCenter() { 193 | return false; //pz || nz || px || nx; 194 | } 195 | } 196 | 197 | public static void movePlayerX(GameControl gc, boolean pos, int yawI) { 198 | if (yawI == 0) { 199 | if (pos) { 200 | gc.pressReleaseLeftKey(true); 201 | } else { 202 | gc.pressReleaseRightKey(true); 203 | } 204 | } else if (yawI == 90) { 205 | if (pos) { 206 | gc.pressReleaseBackKey(true); 207 | } else { 208 | gc.pressReleaseForwardKey(true); 209 | } 210 | } else if (yawI == -90) { 211 | if (pos) { 212 | gc.pressReleaseForwardKey(true); 213 | } else { 214 | gc.pressReleaseBackKey(true); 215 | } 216 | } else { 217 | if (pos) { 218 | gc.pressReleaseRightKey(true); 219 | } else { 220 | gc.pressReleaseLeftKey(true); 221 | } 222 | } 223 | } 224 | 225 | public static void movePlayerZ(GameControl gc, boolean pos, int yawI) { 226 | if (yawI == 0) { 227 | if (pos) { 228 | gc.pressReleaseForwardKey(true); 229 | } else { 230 | gc.pressReleaseBackKey(true); 231 | } 232 | } else if (yawI == 90) { 233 | if (pos) { 234 | gc.pressReleaseLeftKey(true); 235 | } else { 236 | gc.pressReleaseRightKey(true); 237 | } 238 | } else if (yawI == -90) { 239 | if (pos) { 240 | gc.pressReleaseRightKey(true); 241 | } else { 242 | gc.pressReleaseLeftKey(true); 243 | } 244 | } else { 245 | if (pos) { 246 | gc.pressReleaseBackKey(true); 247 | } else { 248 | gc.pressReleaseForwardKey(true); 249 | } 250 | } 251 | } 252 | } 253 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/ListPlayers.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/staging/ListPlayers.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/SolveMaze.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.BlockPos; 4 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 5 | 6 | public class SolveMaze extends CustomModCommandBase { 7 | private BlockPos startPos; 8 | 9 | private double checkX, checkZ; 10 | 11 | private SolveMaze() { 12 | super("solveMaze"); 13 | } 14 | 15 | private static final int FR = 0, FL = 1, BL = 2, BR = 3; 16 | private int state; 17 | 18 | @Override 19 | public void initCmd(String[] args) { 20 | startPos = gameInfo.getLivingEntityLocation(null); 21 | gameControl.pressReleaseRightKey(true); 22 | gameControl.pressReleaseForwardKey(true); 23 | checkX = gameInfo.getPlayerPosX(); 24 | state = FR; 25 | gameControl.executeCommand("turn", new String[] {"0"}); 26 | } 27 | 28 | @Override 29 | public boolean doInUpdateTicThread() { 30 | if (gameInfo.isCommandRunning("turn")) { 31 | return false; 32 | } 33 | BlockPos bp = gameInfo.getLivingEntityLocation(null); 34 | BlockPos bp1 = bp.add(1, 0, 0); 35 | BlockPos bp2 = bp.add(-1, 0, 0); 36 | BlockPos bp3 = bp.add(0, 0, 1); 37 | BlockPos bp4 = bp.add(0, 0, -1); 38 | if ((bp != startPos) && (!(gameInfo.isSolid(bp1))) && (!(gameInfo.isSolid(bp2))) && (!(gameInfo.isSolid(bp3))) 39 | && (!(gameInfo.isSolid(bp4)))) { 40 | gameControl.pressReleaseForwardKey(false); 41 | gameControl.pressReleaseBackKey(false); 42 | gameControl.pressReleaseRightKey(false); 43 | gameControl.pressReleaseLeftKey(false); 44 | return true; 45 | 46 | } 47 | 48 | if (gameInfo.isPlayerChaningLocation()) { 49 | if (state == FR) { 50 | if (checkX - gameInfo.getPlayerPosX() > 1) { 51 | state = BR; 52 | gameControl.pressReleaseForwardKey(false); 53 | gameControl.pressReleaseBackKey(true); 54 | checkZ = gameInfo.getPlayerPosZ(); 55 | } 56 | } else if (state == FL) { 57 | if (checkZ - gameInfo.getPlayerPosZ() < -1) { 58 | state = FR; 59 | gameControl.pressReleaseLeftKey(false); 60 | gameControl.pressReleaseRightKey(true); 61 | checkX = gameInfo.getPlayerPosX(); 62 | } 63 | } else if (state == BR) { 64 | if (checkZ - gameInfo.getPlayerPosZ() > 1) { 65 | state = BL; 66 | gameControl.pressReleaseRightKey(false); 67 | gameControl.pressReleaseLeftKey(true); 68 | checkX = gameInfo.getPlayerPosX(); 69 | } 70 | } else if (state == BL) { 71 | if (checkX - gameInfo.getPlayerPosX() < -1) { 72 | state = FL; 73 | gameControl.pressReleaseForwardKey(true); 74 | gameControl.pressReleaseBackKey(false); 75 | checkZ = gameInfo.getPlayerPosZ(); 76 | } 77 | } 78 | // if (oldS != state) { 79 | // System.out.println("Moving switch: from " + oldS + " to " + state); 80 | // } 81 | return false; 82 | } 83 | if (state == FR) { 84 | state = FL; 85 | gameControl.pressReleaseRightKey(false); 86 | gameControl.pressReleaseLeftKey(true); 87 | checkZ = gameInfo.getPlayerPosZ(); 88 | } else if (state == BL) { 89 | state = BR; 90 | gameControl.pressReleaseRightKey(true); 91 | gameControl.pressReleaseLeftKey(false); 92 | checkZ = gameInfo.getPlayerPosZ(); 93 | } else if (state == FL) { 94 | state = BL; 95 | gameControl.pressReleaseForwardKey(false); 96 | gameControl.pressReleaseBackKey(true); 97 | checkX = gameInfo.getPlayerPosX(); 98 | } else { 99 | state = FR; 100 | gameControl.pressReleaseForwardKey(true); 101 | gameControl.pressReleaseBackKey(false); 102 | checkX = gameInfo.getPlayerPosX(); 103 | } 104 | // if (oldS != state) { 105 | // System.out.println("blocking switch: from " + oldS + " to " + state); 106 | // } 107 | return false; 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/staging/Turn.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.staging; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 4 | import com.logiccity.minecraft.api.util.MathUtils; 5 | 6 | public class Turn extends CustomModCommandBase { 7 | public static final int getAxisesYaw(float yaw) { 8 | yaw = MathUtils.normalYaw(yaw); 9 | int yawI; 10 | if (yaw > -45 && yaw <= 45 ) { 11 | yawI = 0; 12 | } else if (yaw > 45 && yaw <=135) { 13 | yawI = 90; 14 | } else if (yaw > -135 && yaw <= -45) { 15 | yawI = -90; 16 | } else { 17 | yawI = 180; 18 | } 19 | return yawI; 20 | } 21 | 22 | private Turn() { 23 | super("turn", 1, 2); 24 | } 25 | 26 | private float intendedY, intendedP; 27 | @Override 28 | public void initCmd(String[] args) { 29 | intendedY = MathUtils.normalYaw(Float.parseFloat(args[0])); 30 | if (args.length > 1) { 31 | intendedP = Float.parseFloat(args[1]); 32 | } else { 33 | intendedP = Integer.MIN_VALUE; 34 | } 35 | } 36 | 37 | @Override 38 | public boolean doInUpdateTicThread() { 39 | if (intendedP != Integer.MIN_VALUE) { 40 | gameControl.setRotationPitch(intendedP); 41 | intendedP = Integer.MIN_VALUE; 42 | } 43 | if (gameInfo.getRotationYaw() == intendedY) { 44 | return true; 45 | } 46 | safeTurn(intendedY); 47 | return false; 48 | } 49 | 50 | private static final float maxChange = 55; 51 | public final void safeTurn(float intent) { 52 | 53 | final float pre = gameInfo.getPreviousRotationYaw(); 54 | if (pre == intent) { 55 | return; 56 | } 57 | if (pre < intent) { 58 | if (intent - pre > 180) { 59 | float tmp = pre - maxChange; 60 | if (tmp < -180) { 61 | tmp += 360; 62 | } 63 | if (tmp < intent) { 64 | gameControl.setRotationYaw(intent); 65 | } else { 66 | gameControl.setRotationYaw(tmp); 67 | } 68 | } else { 69 | float tmp = pre + maxChange; 70 | if (tmp > intent) { 71 | gameControl.setRotationYaw(intent); 72 | } else { 73 | gameControl.setRotationYaw(tmp); 74 | } 75 | } 76 | } else { //pre > intent 77 | if (pre - intent > 180) { 78 | float tmp = pre + maxChange; 79 | if (tmp > 180) { 80 | tmp -= 360; 81 | } 82 | if (tmp > intent) { 83 | gameControl.setRotationYaw(intent); 84 | } else { 85 | gameControl.setRotationYaw(tmp); 86 | } 87 | } else { 88 | float tmp = pre - maxChange; 89 | if (tmp < intent) { 90 | gameControl.setRotationYaw(intent); 91 | } else { 92 | gameControl.setRotationYaw(tmp); 93 | } 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/AutoMine.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minecraftkids/minecraftOpenMod/fb759fd1395773d7a27ae736df9fe1461a036401/src/main/java/com/logiccity/minecraft/api/command/trial/AutoMine.java -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/AutoStaircase.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class AutoStaircase extends AbstractBuildCommand { 6 | private static int[][] building = 7 | { { 0, 1, 1 }, { 1, 1, 1 }, { -1, 1, 1 }, 8 | { 0, 2, 2 }, { 1, 2, 2 }, { -1, 2, 2 }, 9 | { 0, 3, 3 }, { 1, 3, 3 }, { -1, 3, 3 }, 10 | { 0, 4, 4 }, { 1, 4, 4 }, { -1, 4, 4 }, 11 | { 0, 5, 5 }, { 1, 5, 5 }, { -1, 5, 5 }, 12 | }; 13 | 14 | private AutoStaircase() { 15 | super("staircase", building); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildFloor.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class BuildFloor extends AbstractBuildCommand { 6 | private static int[][] building = 7 | { {1,1,1}, {2,1,1}, {3,1,1}, {4,1,1}, {5,1,1}, {-1,1,1}, {-2,1,1}, {-3,1,1}, {-4,1,1}, {0,1,1}, 8 | {1,1,2}, {2,1,2}, {3,1,2}, {4,1,2}, {5,1,2}, {-1,1,2}, {-2,1,2}, {-3,1,2}, {-4,1,2}, {0,1,2}, 9 | {1,1,3}, {2,1,3}, {3,1,3}, {4,1,3}, {5,1,3}, {-1,1,3}, {-2,1,3}, {-3,1,3}, {-4,1,3}, {0,1,3}, 10 | {1,1,4}, {2,1,4}, {3,1,4}, {4,1,4}, {5,1,4}, {-1,1,4}, {-2,1,4}, {-3,1,4}, {-4,1,4}, {0,1,4}, 11 | {1,1,5}, {2,1,5}, {3,1,5}, {4,1,5}, {5,1,5}, {-1,1,5}, {-2,1,5}, {-3,1,5}, {-4,1,5}, {0,1,5}, 12 | {1,1,6}, {2,1,6}, {3,1,6}, {4,1,6}, {5,1,6}, {-1,1,6}, {-2,1,6}, {-3,1,6}, {-4,1,6}, {0,1,6}, 13 | {1,1,7}, {2,1,7}, {3,1,7}, {4,1,7}, {5,1,7}, {-1,1,7}, {-2,1,7}, {-3,1,7}, {-4,1,7}, {0,1,7}, 14 | {1,1,8}, {2,1,8}, {3,1,8}, {4,1,8}, {5,1,8}, {-1,1,8}, {-2,1,8}, {-3,1,8}, {-4,1,8}, {0,1,8}, 15 | }; 16 | 17 | private BuildFloor() { 18 | super("floor", building); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildLetters.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import com.logiccity.minecraft.api.impl.BuildBooleanArray; 7 | 8 | public class BuildLetters extends BuildBooleanArray { 9 | private static final Map map = new HashMap(); 10 | 11 | static { 12 | map.put('A', new boolean[][] { new boolean[] { true, true, true, true, true }, 13 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true }, 14 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true } }); 15 | 16 | map.put('B', new boolean[][] { new boolean[] { true, true, true, true, false }, 17 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true }, 18 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, false } }); 19 | 20 | map.put('C', new boolean[][] { new boolean[] { true, true, true, true, true }, 21 | new boolean[] { true, false, false, false, false }, new boolean[] { true, false, false, false, false }, 22 | new boolean[] { true, false, false, false, false }, new boolean[] { true, true, true, true, true } }); 23 | map.put('D', new boolean[][] { new boolean[] { true, true, true, true, false }, 24 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true }, 25 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, false } }); 26 | 27 | map.put('E', new boolean[][] { new boolean[] { true, true, true, true, true }, 28 | new boolean[] { true, false, false, false, false }, new boolean[] { true, true, true, true, false }, 29 | new boolean[] { true, false, false, false, false }, new boolean[] { true, true, true, true, true } }); 30 | map.put('F', 31 | new boolean[][] { new boolean[] { true, true, true, true, true }, 32 | new boolean[] { true, false, false, false, false }, 33 | new boolean[] { true, true, true, false, false }, 34 | new boolean[] { true, false, false, false, true }, 35 | new boolean[] { true, false, false, false, false } }); 36 | 37 | map.put('G', new boolean[][] { new boolean[] { true, true, true, true, true }, 38 | new boolean[] { true, false, false, false, false }, new boolean[] { true, false, true, true, true }, 39 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 40 | map.put('H', new boolean[][] { new boolean[] { true, false, false, false, true }, 41 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true }, 42 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true } }); 43 | 44 | map.put('I', new boolean[][] { new boolean[] { true, true, true, true, true }, 45 | new boolean[] { false, false, true, false, false }, new boolean[] { false, false, true, false, false }, 46 | new boolean[] { false, false, true, false, false }, new boolean[] { true, true, true, true, true } }); 47 | map.put('J', new boolean[][] { new boolean[] { true, true, true, true, true }, 48 | new boolean[] { false, false, false, true, false }, new boolean[] { false, false, false, true, false }, 49 | new boolean[] { false, true, false, true, false }, new boolean[] { false, true, true, true, false } }); 50 | 51 | map.put('K', new boolean[][] { new boolean[] { true, true, false, true, true }, 52 | new boolean[] { true, true, false, true, false }, new boolean[] { true, true, true, false, false }, 53 | new boolean[] { true, true, false, true, false }, new boolean[] { true, true, false, false, true } }); 54 | map.put('L', new boolean[][] { new boolean[] { true, false, false, false, false }, 55 | new boolean[] { true, false, false, false, false }, new boolean[] { true, false, false, false, false }, 56 | new boolean[] { true, false, false, false, false }, new boolean[] { true, true, true, true, true } }); 57 | map.put('M', new boolean[][] { new boolean[] { true, false, false, false, true }, 58 | new boolean[] { true, true, false, true, true }, new boolean[] { true, false, true, false, true }, 59 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true } }); 60 | map.put('N', new boolean[][] { new boolean[] { true, false, false, false, true }, 61 | new boolean[] { true, true, false, false, true }, new boolean[] { true, false, true, false, true }, 62 | new boolean[] { true, false, false, true, true }, new boolean[] { true, false, false, false, true } }); 63 | map.put('O', new boolean[][] { new boolean[] { true, true, true, true, true }, 64 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true }, 65 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 66 | map.put('P', 67 | new boolean[][] { new boolean[] { true, true, true, true, true }, 68 | new boolean[] { true, false, false, false, true }, 69 | new boolean[] { true, true, true, true, true }, 70 | new boolean[] { true, false, false, false, false }, 71 | new boolean[] { true, false, false, false, false } }); 72 | map.put('Q', new boolean[][] { new boolean[] { true, true, true, true, true }, 73 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true }, 74 | new boolean[] { true, false, false, true, true }, new boolean[] { true, true, true, true, true } }); 75 | map.put('R', new boolean[][] { new boolean[] { true, true, true, true, true }, 76 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true }, 77 | new boolean[] { true, false, false, true, false }, new boolean[] { true, false, false, false, true } }); 78 | map.put('S', new boolean[][] { new boolean[] { true, true, true, true, true }, 79 | new boolean[] { true, false, false, false, false }, new boolean[] { true, true, true, true, true }, 80 | new boolean[] { false, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 81 | map.put('T', 82 | new boolean[][] { new boolean[] { true, true, true, true, true }, 83 | new boolean[] { false, false, true, false, false }, 84 | new boolean[] { false, false, true, false, false }, 85 | new boolean[] { false, false, true, false, false }, 86 | new boolean[] { false, false, true, false, false } }); 87 | map.put('U', new boolean[][] { new boolean[] { true, false, false, false, true }, 88 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true }, 89 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 90 | map.put('V', 91 | new boolean[][] { new boolean[] { true, false, false, false, true }, 92 | new boolean[] { true, false, false, false, true }, 93 | new boolean[] { false, true, false, true, false }, 94 | new boolean[] { false, true, false, true, false }, 95 | new boolean[] { false, false, true, false, false } }); 96 | map.put('W', new boolean[][] { new boolean[] { true, false, false, false, true }, 97 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, true, false, true }, 98 | new boolean[] { true, true, false, true, true }, new boolean[] { true, false, false, false, true } }); 99 | map.put('X', new boolean[][] { new boolean[] { true, false, false, false, true }, 100 | new boolean[] { false, true, false, true, false }, new boolean[] { false, false, true, false, false }, 101 | new boolean[] { false, true, false, true, false }, new boolean[] { true, false, false, false, true } }); 102 | map.put('Y', 103 | new boolean[][] { new boolean[] { true, false, false, false, true }, 104 | new boolean[] { false, true, false, true, false }, 105 | new boolean[] { false, false, true, false, false }, 106 | new boolean[] { false, false, true, false, false }, 107 | new boolean[] { false, false, true, false, false } }); 108 | map.put('Z', new boolean[][] { new boolean[] { true, true, true, true, true }, 109 | new boolean[] { false, false, false, true, false }, new boolean[] { false, false, true, false, false }, 110 | new boolean[] { false, true, false, false, false }, new boolean[] { true, true, true, true, true } }); 111 | map.put('0', new boolean[][] { new boolean[] { true, true, true, true, true }, 112 | new boolean[] { true, false, false, false, true }, new boolean[] { true, false, false, false, true }, 113 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 114 | map.put('1', new boolean[][] { new boolean[] { true, true, true, false, false }, 115 | new boolean[] { false, false, true, false, false }, new boolean[] { false, false, true, false, false }, 116 | new boolean[] { false, false, true, false, false }, new boolean[] { true, true, true, true, true } }); 117 | map.put('2', new boolean[][] { new boolean[] { false, true, true, true, false }, 118 | new boolean[] { true, false, false, false, true }, new boolean[] { false, false, false, true, false }, 119 | new boolean[] { false, false, true, false, false }, new boolean[] { true, true, true, true, true } }); 120 | map.put('3', new boolean[][] { new boolean[] { true, true, true, true, true }, 121 | new boolean[] { false, false, false, false, true }, new boolean[] { false, true, true, true, true }, 122 | new boolean[] { false, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 123 | map.put('4', 124 | new boolean[][] { new boolean[] { true, false, false, false, true }, 125 | new boolean[] { true, false, false, false, true }, 126 | new boolean[] { true, true, true, true, true }, 127 | new boolean[] { false, false, false, false, true }, 128 | new boolean[] { false, false, false, false, true } }); 129 | map.put('5', new boolean[][] { new boolean[] { false, true, true, true, true }, 130 | new boolean[] { true, false, false, false, false }, new boolean[] { true, true, true, true, true }, 131 | new boolean[] { false, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 132 | map.put('6', new boolean[][] { new boolean[] { true, true, true, true, true }, 133 | new boolean[] { true, false, false, false, false }, new boolean[] { true, true, true, true, true }, 134 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 135 | map.put('7', 136 | new boolean[][] { new boolean[] { true, true, true, true, true }, 137 | new boolean[] { false, false, false, false, true }, 138 | new boolean[] { false, false, false, true, false }, 139 | new boolean[] { false, false, true, false, false }, 140 | new boolean[] { false, true, false, false, false } }); 141 | map.put('8', new boolean[][] { new boolean[] { true, true, true, true, true }, 142 | new boolean[] { true, false, false, false, true }, new boolean[] { false, true, true, true, false }, 143 | new boolean[] { true, false, false, false, true }, new boolean[] { true, true, true, true, true } }); 144 | map.put('9', 145 | new boolean[][] { new boolean[] { true, true, true, true, true }, 146 | new boolean[] { true, false, false, false, true }, 147 | new boolean[] { true, true, true, true, true }, 148 | new boolean[] { false, false, false, false, true }, 149 | new boolean[] { false, false, false, false, true } }); 150 | 151 | } 152 | 153 | private BuildLetters() { 154 | super("letters", 1); 155 | } 156 | 157 | private boolean[][] switchXY(boolean[][] in) { 158 | boolean[][] out = new boolean[in[0].length][in.length]; 159 | for (int i = 0; i < in[0].length; i++) { 160 | for (int j = 0; j < in.length; j++) { 161 | out[i][j] = in[j][i]; 162 | } 163 | } 164 | return out; 165 | } 166 | 167 | @Override 168 | public void initCmd(String[] args) { 169 | int cnt = 0; 170 | String input = args[0].toUpperCase(); 171 | int length = 7 * input.length() - 2; 172 | maze = new boolean[length][5]; 173 | for (char ch : input.toCharArray()) { 174 | boolean[][] array = switchXY(map.get(ch)); 175 | for (int i = 0; i < array[0].length; i++) { 176 | for (int j = 0; j < array.length; j++) { 177 | maze[i + cnt * 7][j] = array[i][j]; 178 | } 179 | } 180 | cnt++; 181 | } 182 | startBp = gameInfo.getLivingEntityLocation(null).add(0, 0, 3); 183 | super.initCmd(args); 184 | } 185 | 186 | } 187 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildMaze.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.BuildBooleanArray; 4 | 5 | public class BuildMaze extends BuildBooleanArray { 6 | 7 | private int width, length; 8 | 9 | protected BuildMaze() { 10 | super("buildMaze", 2, 3); 11 | } 12 | protected BuildMaze(String cheatName) { 13 | super(true, cheatName, 2, 3); 14 | } 15 | @Override 16 | public void initCmd(String [] args) { 17 | width = Integer.parseInt(args[0]); 18 | length = Integer.parseInt(args[1]); 19 | if (args.length > 2) { 20 | height = Integer.parseInt(args[2]); 21 | } 22 | maze = gameInfo.generateMaze(width, length); 23 | startBp = gameInfo.getLivingEntityLocation(null).add(0, 0, 3); 24 | super.initCmd(args); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildPlay.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import java.util.ArrayList; 4 | 5 | import com.logiccity.minecraft.api.BlockPos; 6 | import com.logiccity.minecraft.api.BuildStepRecord; 7 | import com.logiccity.minecraft.api.command.staging.GoToCmd; 8 | import com.logiccity.minecraft.api.command.staging.Turn; 9 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 10 | 11 | public class BuildPlay extends CustomModCommandBase { 12 | 13 | private ArrayList steps; 14 | private int idx = 0, yawI; 15 | private BlockPos currTarget = null; 16 | private BuildStepRecord currentRec = null; 17 | private boolean stepAttempted = false; 18 | private boolean shouldJumpBuild = false, isDestroy = false; 19 | 20 | private BuildPlay() { 21 | super("replay", 1); 22 | } 23 | 24 | @Override 25 | public void initCmd(String [] args) { 26 | idx = 0; 27 | stepAttempted = false; 28 | shouldJumpBuild = false; 29 | isDestroy = false; 30 | steps = gameInfo.loadRecordedBuildingSteps(args[0]); 31 | } 32 | @Override 33 | public void cleanupCmd() { 34 | steps = null; 35 | } 36 | 37 | @Override 38 | public boolean doInUpdateTicThread() { 39 | if (stepAttempted) { 40 | if (isDestroy) { 41 | if (gameInfo.isSolid(currTarget)) { 42 | return false; 43 | } 44 | } else if (! gameInfo.isSolid(currTarget)) { 45 | int dx = currTarget.getX() - (int) Math.floor(gameInfo.getPlayerPosX()), 46 | dz = currTarget.getZ() - (int) Math.floor(gameInfo.getPlayerPosZ()); 47 | if (dx != 0 || dz != 0) { 48 | if (Math.abs(dx) + Math.abs(dz) < 2.9) { 49 | GoToCmd.movePlayerX(gameControl, dx < 0, yawI); 50 | GoToCmd.movePlayerZ(gameControl, dz < 0, yawI); 51 | } else { 52 | GoToCmd.resetControls(gameControl); 53 | } 54 | if (hasMillisPassed(200)) { 55 | buildRecordedStep(); 56 | } 57 | return false; 58 | } else { 59 | shouldJumpBuild = true; 60 | idx --; 61 | } 62 | } 63 | stepAttempted = false; 64 | GoToCmd.resetControls(gameControl); 65 | } 66 | if (shouldJumpBuild) { 67 | gameControl.pressReleaseJumpKey(true); 68 | // System.out.println("|||bp:" + currTarget); 69 | // System.out.println("|||player@(" + player.posX + "," + player.posY + "," + player.posZ + ")"); 70 | if (gameInfo.getPlayerPosY() - currTarget.getY() > 1) { 71 | buildRecordedStep(); 72 | shouldJumpBuild = false; 73 | idx ++; 74 | gameControl.pressReleaseJumpKey(false); 75 | } 76 | return false; 77 | } 78 | if (idx < steps.size()) { 79 | if (gameInfo.isCommandRunning("goto") || gameInfo.isCommandRunning("turn")) { 80 | return false; 81 | } 82 | currentRec = steps.get(idx); 83 | isDestroy = currentRec.blockAction != null && (! currentRec.blockAction.isEmpty()); 84 | currTarget = new BlockPos(currentRec.blockPos.x, currentRec.blockPos.y, currentRec.blockPos.z); 85 | if (! isDestroy) { 86 | currTarget = getTargetBlockPos(currTarget, currentRec.placeDir); 87 | } 88 | 89 | if (currTarget == null || (gameInfo.isSolid(currTarget) && (! isDestroy)) || 90 | ((! gameInfo.isSolid(currTarget)) && isDestroy) ) { 91 | idx ++; 92 | return false; 93 | } 94 | if (Math.floor(gameInfo.getPlayerPosX()) != Math.floor(currentRec.playerLoc.x) 95 | || Math.floor(gameInfo.getPlayerPosZ()) != Math.floor(currentRec.playerLoc.z)) { 96 | gameControl.executeCommand("goto", new String[] { String.valueOf(currentRec.playerLoc.x), 97 | String.valueOf(currentRec.playerLoc.y), String.valueOf(currentRec.playerLoc.z)}); 98 | return false; 99 | } 100 | yawI = Turn.getAxisesYaw(currentRec.playerYaw); 101 | if (Math.abs(gameInfo.getRotationYaw() - yawI) > 0.1) { 102 | gameControl.executeCommand("turn", new String[] {String.valueOf(yawI), String.valueOf(currentRec.playerPitch)}); 103 | return false; 104 | } 105 | if (isDestroy) { 106 | destoryBlock(); 107 | idx ++; 108 | return false; 109 | } 110 | if (gameControl.setPlayerCurrentItem(currentRec.currentItem)) { 111 | return false; 112 | } 113 | 114 | if (currTarget.equals(gameInfo.getLivingEntityLocation(null))) { 115 | shouldJumpBuild = true; 116 | return false; 117 | } 118 | buildRecordedStep(); 119 | idx ++; 120 | return false; 121 | } else { 122 | GoToCmd.resetControls(gameControl); 123 | return true; 124 | } 125 | } 126 | 127 | private BlockPos getTargetBlockPos(BlockPos bp, int placeDir) { 128 | if (placeDir == 1) { 129 | return bp.add(0, 1, 0); 130 | } else if (placeDir == 0) { 131 | return bp.add(0, -1, 0); 132 | } else if (placeDir == 2) { 133 | return bp.add(0, 0, -1); 134 | } else if (placeDir == 3) { 135 | return bp.add(0, 0, 1); 136 | } else if (placeDir == 4) { 137 | return bp.add(-1, 0, 0); 138 | } else if (placeDir == 5) { 139 | return bp.add(1, 0, 0); 140 | } else { 141 | return null; 142 | } 143 | } 144 | 145 | private void destoryBlock() { 146 | gameControl.sendDestoryBlockAt(currTarget, currentRec.facing); 147 | stepAttempted = true; 148 | } 149 | 150 | private void buildRecordedStep() { 151 | gameControl.playerSwingItem(); 152 | // System.out.println("---bp:" + bp); 153 | // System.out.println("---player:" + player.posX + "," + player.posY + "," + player.posZ); 154 | gameControl.sendBlockPlacementPacket(currentRec.blockPos.x, currentRec.blockPos.y, currentRec.blockPos.z, 155 | currentRec.placeDir); 156 | stepAttempted = true; 157 | resetMillis(); 158 | } 159 | 160 | } 161 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildPole.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.BlockPos; 4 | import com.logiccity.minecraft.api.impl.CustomModCommandBase; 5 | 6 | public class BuildPole extends CustomModCommandBase { 7 | private BlockPos bp; 8 | 9 | private BuildPole() { 10 | super("pole"); 11 | } 12 | 13 | @Override 14 | public void initCmd(String [] args) { 15 | bp = gameInfo.getLivingEntityLocation(null); 16 | gameControl.setRotationPitch(90); 17 | } 18 | 19 | @Override 20 | public boolean doInUpdateTicThread() { 21 | gameControl.pressReleaseJumpKey(true); 22 | if ( gameInfo.getPlayerPosY() > bp.getY() + 1) { 23 | gameControl.sendBlockPlacementPacket(bp.getX(), bp.getY() - 1, bp.getZ(), 1); 24 | gameControl.pressReleaseJumpKey(false); 25 | return true; 26 | } 27 | return false; 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildRecord.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomCommandBase; 4 | 5 | 6 | public class BuildRecord extends CustomCommandBase { 7 | private BuildRecord() { 8 | super("recordB", 1); 9 | } 10 | 11 | @Override 12 | public void execute(String[] args) { 13 | gameControl.recordBuildingSteps(args[0]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildStopRecord.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomCommandBase; 4 | 5 | 6 | public class BuildStopRecord extends CustomCommandBase { 7 | private BuildStopRecord() { 8 | super("stopR"); 9 | } 10 | 11 | @Override 12 | public void execute(String[] args) { 13 | gameControl.stopRecordSteps(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/BuildWall.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class BuildWall extends AbstractBuildCommand { 6 | private static int[][] building = 7 | { { 0, 1, 2 }, { 1, 1, 2 }, { -1, 1, 2 }, { 2, 1, 2 }, { -2, 1, 2 }, 8 | { 0, 2, 2 }, { 1, 2, 2 }, { -1, 2, 2 }, { 2, 2, 2 }, { -2, 2, 2 }, 9 | { 0, 3, 2 }, { 1, 3, 2 }, { -1, 3, 2 }, { 2, 3, 2 }, { -2, 3, 2 }, 10 | }; 11 | 12 | private BuildWall() { 13 | super("buildWall", building); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/Jump.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomCommandBase; 4 | 5 | public class Jump extends CustomCommandBase { 6 | private Jump() { 7 | super("jump"); 8 | } 9 | 10 | @Override 11 | public void execute(final String[] args) { 12 | gameControl.playerJumpOnce(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/RecordAll.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomCommandBase; 4 | 5 | 6 | public class RecordAll extends CustomCommandBase { 7 | private RecordAll() { 8 | super("recordA", 1); 9 | } 10 | 11 | @Override 12 | public void execute(String[] args) { 13 | gameControl.recordAllSteps(args[0]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/Small.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class Small extends AbstractBuildCommand { 6 | private static final int[][] building = 7 | { { 2, 1 , 2 }, { 2, 1, 3 }, { 2, 1, 4 }, { 2, 1, 5 }, { 2, 1, 6 }, 8 | { 1, 1 , 2 }, { 1, 1, 3 }, { 1, 1, 4 }, { 1, 1, 5 }, { 1, 1, 6 }, 9 | { 0, 1 , 2 }, { 0, 1, 3 }, { 0, 1, 4 }, { 0, 1, 5 }, { 0, 1, 6 }, 10 | { -1, 1 , 2 }, { -1, 1, 3 }, { -1, 1, 4 }, { -1, 1, 5 }, { -1,1, 6 }, 11 | { -2, 1 , 2 }, { -2, 1, 3 }, { -2, 1, 4 }, { -2, 1, 5 }, { -2, 1, 6 }, 12 | 13 | { 1, 2, 3 }, { 1, 2, 4 }, { 1, 2, 5 }, 14 | { 0, 2, 3 }, { 0, 2, 4 }, { 0, 2, 5 }, 15 | { -1, 2, 3 }, { -1, 2, 4 }, { -1, 2, 5 }, 16 | 17 | 18 | { 0, 3, 4 }, 19 | 20 | 21 | 22 | 23 | }; 24 | 25 | private Small() { 26 | super("smallpyramidfront", building); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/SmallPrymaid.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class SmallPrymaid extends AbstractBuildCommand { 6 | private static final int[][] building = 7 | { { 2, -2 , -2 }, { 2, -2, -1 }, { 2, -2, 0 }, { 2, -2, 1 }, { 2, -2, 2 }, 8 | { 1, -2 , -2 }, { 1, -2, -1 }, { 1, -2, 0 }, { 1, -2, 1 }, { 1, -2, 2 }, 9 | { 0, -2 , -2 }, { 0, -2, -1 }, { 0, -2, 0 }, { 0, -2, 1 }, { 0, -2, 2 }, 10 | { -1, -2 , -2 }, { -1, -2, -1 }, { -1, -2, 0 }, { -1, -2, 1 }, { -1,-2, 2 }, 11 | { -2, -2 , -2 }, { -2,-2, -1 }, { -2, -2, 0 }, { -2, -2, 1 }, { -2, -2, 2 }, 12 | 13 | { 1, -1, -1 }, { 1, -1, 0 }, { 1, -1, 1 }, 14 | { 0, -1, -1 }, { 0, -1, 0 }, { 0, -1, 1 }, 15 | { -1, -1, -1 }, { -1, -1, 0 }, { -1, -1, 1 }, 16 | 17 | 18 | { 0, 0, 0 }, 19 | 20 | 21 | 22 | 23 | }; 24 | private SmallPrymaid() { 25 | super("smallpyramiddown", building); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/SmallTriangle.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class SmallTriangle extends AbstractBuildCommand { 6 | private static final int[][] building = 7 | { { 2, 3 , -2 }, { 2, 3, -1 }, { 2, 3, 0 }, { 2, 3, 1 }, { 2, 3, 2 }, 8 | { 1, 3 , -2 }, { 1, 3, -1 }, { 1, 3, 0 }, { 1, 3, 1 }, { 1, 3, 2 }, 9 | { 0, 3 , -2 }, { 0, 3, -1 }, { 0, 3, 0 }, { 0, 3, 1 }, { 0, 3, 2 }, 10 | { -1, 3 , -2 }, { -1, 3, -1 }, { -1, 3, 0 }, { -1, 3, 1 }, { -1,3, 2 }, 11 | { -2, 3 , -2 }, { -2, 3, -1 }, { -2, 3, 0 }, { -2, 3, 1 }, { -2, 3, 2 }, 12 | 13 | { 1, 4, -1 }, { 1, 4, 0 }, { 1, 4, 1 }, 14 | { 0, 4, -1 }, { 0, 4, 0 }, { 0, 4, 1 }, 15 | { -1, 4, -1 }, { -1, 4, 0 }, { -1, 4, 1 }, 16 | 17 | 18 | { 0, 5, 0 }, 19 | 20 | 21 | 22 | 23 | }; 24 | private SmallTriangle() { 25 | super("smallpyramidup", building); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/TallWall.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class TallWall extends AbstractBuildCommand { 6 | private static final int[][] building = 7 | { { 0, 1, 2 }, { 1, 1, 2 }, { -1, 1, 2 }, { 2, 1, 2 }, { -2, 1, 2 }, 8 | { 0, 2, 2 }, { 1, 2, 2 }, { -1, 2, 2 }, { 2, 2, 2 }, { -2, 2, 2 }, 9 | { 0, 3, 2 }, { 1, 3, 2 }, { -1, 3, 2 }, { 2, 3, 2 }, { -2, 3, 2 }, 10 | { 0, 4, 2 }, { 1, 4, 2 }, { -1, 4, 2 }, { 2, 4, 2 }, { -2, 4, 2 }, 11 | { 0, 5, 2 }, { 1, 5, 2 }, { -1, 5, 2 }, { 2, 5, 2 }, { -2, 5, 2 }, 12 | { 0, 6, 2 }, { 1, 6, 2 }, { -1, 6, 2 }, { 2, 6, 2 }, { -2, 6, 2 }, 13 | { 0, 7, 2 }, { 1, 7, 2 }, { -1, 7, 2 }, { 2, 7, 2 }, { -2, 7, 2 }, 14 | 15 | }; 16 | private TallWall() { 17 | super("TWall", building); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/TallWallDiagonal.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class TallWallDiagonal extends AbstractBuildCommand { 6 | private static final int[][] building = 7 | { { 0, 1, 0 }, { 1, 1, 1 }, { -1, 1, -1 }, { 2, 1, 2 }, { -2, 1, -2 }, 8 | { 0, 2, 0 }, { 1, 2, 1 }, { -1, 2, -1 }, { 2, 2, 2 }, { -2, 2, -2 }, 9 | { 0, 3, 0 }, { 1, 3, 1 }, { -1, 3, -1 }, { 2, 3, 2 }, { -2, 3, -2 }, 10 | { 0, 4, 0 }, { 1, 4, 1 }, { -1, 4, -1 }, { 2, 4, 2 }, { -2, 4, -2 }, 11 | { 0, 5, 0 }, { 1, 5, 1 }, { -1, 5, -1 }, { 2, 5, 2 }, { -2, 5, -2 }, 12 | { 0, 6, 0 }, { 1, 6, 1 }, { -1, 6, -1 }, { 2, 6, 2 }, { -2, 6, -2 }, 13 | { 0, 7, 0 }, { 1, 7, 1 }, { -1, 7, -1 }, { 2, 7, 2 }, { -2, 7, -2 }, 14 | 15 | }; 16 | 17 | private TallWallDiagonal() { 18 | super("TWDiagonal", building); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/TallWallSide.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.AbstractBuildCommand; 4 | 5 | public class TallWallSide extends AbstractBuildCommand { 6 | private static final int[][] building = 7 | //Wall in front 8 | { { -1, 1, 2 },{ -2, 1, 2 },{ 0, 1, 2 }, { 1, 1, 2 }, { 2, 1, 2 }, { 3, 1, 2 }, { -3, 1, 2 }, { 4, 1, 2 }, { -4, 1, 2 }, { 5, 1, 2 }, 9 | { -5, 1, 2 }, { -5, 1, 1 }, { -5, 1, 0}, { -5, 1, -1 }, { -5, 1, -2 }, { -5, 1, -3 }, { -5, 1, -4 }, { -5, 1, -5 }, { -5, 1, -6 }, 10 | { 0, 1, -6 }, { 1, 1, -6 }, { -1, 1, -6 }, { 2, 1, -6 },{ -2, 1, -6 }, { -3, 1, -6 }, { 3, 1, -6 }, { -4, 1, -6 }, { 4, 1, -6 }, { -5, 1, -6 }, { 5, 1, -6 }, 11 | }; 12 | 13 | private TallWallSide() { 14 | super("TWSide", building); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/command/trial/TpCmd.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.command.trial; 2 | 3 | import com.logiccity.minecraft.api.impl.CustomCommandBase; 4 | 5 | public class TpCmd extends CustomCommandBase { 6 | private TpCmd() { 7 | super("tpo",3); 8 | } 9 | 10 | @Override 11 | public void execute(final String[] args) { 12 | double x = Double.valueOf(args[0]); 13 | double y = Double.valueOf(args[1]); 14 | double z = Double.valueOf(args[2]); 15 | gameControl.setPlayerLocation(x,y,z); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/impl/AbstractBuildCommand.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.impl; 2 | 3 | 4 | import com.logiccity.minecraft.api.util.MathUtils; 5 | 6 | public abstract class AbstractBuildCommand extends CustomModCommandBase { 7 | 8 | 9 | private int[][] building; 10 | private float yaw; 11 | private double x, y, z; 12 | private int idx = 0; 13 | 14 | protected AbstractBuildCommand(String name, int [][] building) { 15 | super(name, 0, 3); 16 | this.building = building; 17 | } 18 | 19 | @Override 20 | public void initCmd(String[] args) { 21 | yaw = gameInfo.getRotationYaw(); 22 | yaw = MathUtils.normalYaw(yaw); 23 | if (args == null || args.length < 3) { 24 | x = gameInfo.getPlayerPosX(); 25 | y = gameInfo.getPlayerPosY(); 26 | z = gameInfo.getPlayerPosZ(); 27 | } else { 28 | x = Double.parseDouble(args[0]); 29 | y = Double.parseDouble(args[1]); 30 | z = Double.parseDouble(args[2]); 31 | gameControl.executeCommand("goto", new String[] { args[0], args[1], args[2] }); 32 | } 33 | } 34 | 35 | @Override 36 | public void cleanupCmd() { 37 | gameControl.executeCommand("turn", new String [] {String.valueOf(yaw)}); 38 | } 39 | 40 | @Override 41 | public boolean doInUpdateTicThread() { 42 | if (idx < building.length) { 43 | int [] buildingI = building[idx ++]; 44 | gameControl.buildOneBlock(buildingI, yaw, x + 1, y, z); 45 | return false; 46 | } 47 | return true; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/impl/ApiCommandBase.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.impl; 2 | 3 | import com.logiccity.minecraft.api.GameControl; 4 | import com.logiccity.minecraft.api.GameInfo; 5 | 6 | public abstract class ApiCommandBase { 7 | private long lastMS; 8 | protected GameControl gameControl = null; 9 | protected GameInfo gameInfo = null; 10 | private int[] argNums; 11 | private String name; 12 | private char keyChar = Character.MIN_VALUE; 13 | protected ApiCommandBase(String name, int... args) { 14 | this.name = name; 15 | this.argNums = args; 16 | } 17 | 18 | protected ApiCommandBase(String name, String key, int... args) { 19 | this(name, args); 20 | if (key != null && key.length() == 1) { 21 | key = key.toUpperCase(); 22 | keyChar = key.charAt(0); 23 | } 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public char getKeyChar() { 31 | return keyChar; 32 | } 33 | public int[] argNums() { 34 | return argNums; 35 | } 36 | 37 | public void setGameControl(GameControl gameControl) { 38 | this.gameControl = gameControl; 39 | } 40 | 41 | public void setGameInfo(GameInfo gameInfo) { 42 | this.gameInfo = gameInfo; 43 | } 44 | 45 | public GameControl getGameControl() { 46 | return gameControl; 47 | } 48 | 49 | public GameInfo getGameInfo() { 50 | return gameInfo; 51 | } 52 | 53 | public boolean hasMillisPassed(long delta) { 54 | long cms = System.currentTimeMillis(); 55 | boolean passed = cms > lastMS + delta; 56 | if (passed) { 57 | lastMS = cms; 58 | } 59 | return passed; 60 | } 61 | 62 | public void resetMillis() { 63 | lastMS = System.currentTimeMillis(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/impl/BuildBooleanArray.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.impl; 2 | 3 | import com.logiccity.minecraft.api.BlockPos; 4 | 5 | public class BuildBooleanArray extends CustomModCommandBase { 6 | private boolean cheatMode = false; 7 | private int width, length, cx, cz; 8 | protected boolean[][] maze; 9 | private BlockPos cBP = null; 10 | protected BlockPos startBp; 11 | protected int height = 1; 12 | protected BuildBooleanArray(String name, int... args) { 13 | super(name, args); 14 | } 15 | protected BuildBooleanArray(boolean cheatMode, String name, int... args) { 16 | super(name, args); 17 | this.cheatMode = cheatMode; 18 | } 19 | @Override 20 | public void initCmd(String [] args) { 21 | gameControl.executeCommand("turn", new String[] {"0", "0"}); 22 | width = maze.length; 23 | length = maze[0].length; 24 | while(! checkBp(startBp)) { 25 | startBp = startBp.add(1, 0, 0); 26 | } 27 | cBP = null; 28 | cx = -1; 29 | cz = 0; 30 | } 31 | 32 | private boolean checkBp(BlockPos bp1) { 33 | BlockPos bp2 = bp1.add(-width, 0, 0), bp3 = bp2.add(0, 0, -length-3), 34 | bp4 = bp1.add(0, 0, -length-3); 35 | BlockPos bp = bp1; 36 | while (bp.getZ() >= bp4.getZ()) { 37 | while (bp.getX() >= bp2.getX()) { 38 | if (gameInfo.isSolid(bp) || (! gameInfo.isSolid(bp.add(0, -1, 0)))) { 39 | return false; 40 | } 41 | bp = bp.add(-1, 0, 0); 42 | } 43 | bp = bp.add(0, 0, -1); 44 | } 45 | return true; 46 | } 47 | 48 | @Override 49 | public boolean doInUpdateTicThread() { 50 | if (gameInfo.isCommandRunning("goto") || gameInfo.isCommandRunning("turn")) { 51 | return false; 52 | } 53 | if (cBP == null || gameInfo.isSolid(cBP)) { 54 | if (cx == width -1) { 55 | cx = 0; 56 | cz ++; 57 | } else { 58 | cx ++; 59 | } 60 | if (cz == length) { 61 | return true; 62 | } 63 | cBP = startBp.add(-cx, 0, -cz); 64 | } else if (cBP != null) { 65 | BlockPos playerBP = gameInfo.getLivingEntityLocation(null); 66 | if (Math.abs(playerBP.getX() -cBP.getX()) > 3 || cBP.getZ() - playerBP.getZ() < 2) { 67 | gameControl.executeCommand( 68 | cheatMode ? "tpo" : "goto", new String[] {String.valueOf(cBP.getX()), 69 | String.valueOf(cBP.getY()), String.valueOf(cBP.getZ()-3)}); 70 | return false; 71 | } 72 | } 73 | if (maze[cx][cz]) { 74 | gameControl.playerSwingItem(); 75 | for(int i=0;i syncCmds = new LinkedHashMap(); 52 | 53 | @Override 54 | public void addToSyncCmds(String cmdName, String argStr) { 55 | String [] args; 56 | if (argStr == null || (argStr = argStr.trim()).length() == 0) { 57 | args = new String[0]; 58 | } else { 59 | args = argStr.split("[ ,]+"); 60 | } 61 | syncCmds.put(cmdName, args); 62 | } 63 | 64 | public LinkedHashMap getSyncCmds() { 65 | return syncCmds; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/util/MathUtils.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.util; 2 | 3 | public class MathUtils { 4 | public static final float normalYaw(float yaw) { 5 | while (yaw > 180) { 6 | yaw -= 360; 7 | } 8 | while (yaw < -180) { 9 | yaw += 360; 10 | } 11 | return yaw; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/util/PathFinder.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.Comparator; 6 | import java.util.HashMap; 7 | import java.util.PriorityQueue; 8 | 9 | import com.logiccity.minecraft.api.BlockPos; 10 | import com.logiccity.minecraft.api.GameInfo; 11 | 12 | public class PathFinder { 13 | private BlockPos goal; 14 | private PriorityQueue queue; 15 | private HashMap processed = new HashMap(); 16 | private PathPoint lastPoint; 17 | private GameInfo gameInfo; 18 | public PathFinder(GameInfo gi, BlockPos goal) { 19 | this.goal = goal; 20 | gameInfo =gi; 21 | queue = new PriorityQueue(new Comparator() { 22 | @Override 23 | public int compare(PathPoint o1, PathPoint o2) { 24 | if (o1.getPriority() < o2.getPriority()) 25 | return -1; 26 | else if (o1.getPriority() > o2.getPriority()) 27 | return 1; 28 | else if (getDistance(o1.getPos(), PathFinder.this.goal) < getDistance( 29 | o2.getPos(), PathFinder.this.goal)) 30 | return -1; 31 | else if (getDistance(o1.getPos(), PathFinder.this.goal) > getDistance( 32 | o2.getPos(), PathFinder.this.goal)) 33 | return 1; 34 | else 35 | return 0; 36 | } 37 | }); 38 | addPoint(gameInfo.getLivingEntityLocation(null), null, 0, 0); 39 | } 40 | 41 | public boolean find() { 42 | long startTime = System.currentTimeMillis(); 43 | boolean foundPath = false; 44 | while (!queue.isEmpty()) { 45 | lastPoint = queue.poll(); 46 | processed.put(lastPoint.getPos(), lastPoint); 47 | BlockPos lbp = lastPoint.getPos(); 48 | if (lbp.getX() == goal.getX() && lbp.getZ() == goal.getZ()) { 49 | foundPath = true; 50 | break; 51 | } 52 | if (System.currentTimeMillis() - startTime > 10000) { 53 | System.err.println("Path finding took more than 10s. Aborting!"); 54 | return false; 55 | } 56 | for (BlockPos next : lastPoint.getNeighbors()) { 57 | if (!PathUtils.isSafe(next, gameInfo)) 58 | continue; 59 | int nextCost = PathUtils.getCost(next, gameInfo); 60 | int newCost = lastPoint.getMovementCost() + nextCost; 61 | if (!processed.containsKey(next) 62 | || processed.get(next).getMovementCost() > newCost) 63 | addPoint(next, lastPoint, newCost, 64 | newCost + getDistance(next, goal) * nextCost); 65 | } 66 | } 67 | System.out.println("Processed " + processed.size() + " nodes"); 68 | return foundPath; 69 | } 70 | 71 | private void addPoint(BlockPos pos, PathPoint previous, int movementCost, 72 | int priority) { 73 | queue.add(new PathPoint(pos, previous, movementCost, priority, gameInfo)); 74 | } 75 | 76 | private int getDistance(BlockPos a, BlockPos b) { 77 | return Math.abs(a.getX() - b.getX()) + Math.abs(a.getY() - b.getY()) 78 | + Math.abs(a.getZ() - b.getZ()); 79 | } 80 | 81 | public PathPoint getRawPath() { 82 | return lastPoint; 83 | } 84 | 85 | public ArrayList formatPath() { 86 | ArrayList path = new ArrayList(); 87 | PathPoint point = lastPoint; 88 | while (point != null) { 89 | path.add(point.getPos()); 90 | point = point.getPrevious(); 91 | } 92 | Collections.reverse(path); 93 | for (int i = path.size() - 1; i > 1; i--) 94 | if (path.get(i).getX() == path.get(i - 2).getX() 95 | && path.get(i).getY() == path.get(i - 2).getY() 96 | || path.get(i).getX() == path.get(i - 2).getX() 97 | && path.get(i).getZ() == path.get(i - 2).getZ() 98 | || path.get(i).getY() == path.get(i - 2).getY() 99 | && path.get(i).getZ() == path.get(i - 2).getZ()) 100 | path.remove(i - 1); 101 | return path; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/util/PathPoint.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.util; 2 | 3 | import java.util.ArrayList; 4 | 5 | import com.logiccity.minecraft.api.BlockPos; 6 | import com.logiccity.minecraft.api.GameInfo; 7 | 8 | public class PathPoint { 9 | private BlockPos pos; 10 | private PathPoint previous; 11 | private int priority; 12 | private int movementCost; 13 | private GameInfo gameInfo; 14 | 15 | public PathPoint(BlockPos pos, PathPoint previous, int movementCost, 16 | int priority, GameInfo gi) { 17 | this.pos = pos; 18 | this.previous = previous; 19 | this.movementCost = movementCost; 20 | this.priority = priority; 21 | gameInfo = gi; 22 | } 23 | 24 | public ArrayList getNeighbors() { 25 | BlockPos playerPos = gameInfo.getLivingEntityLocation(null); 26 | ArrayList neighbors = new ArrayList(); 27 | neighbors.add(pos.add(0, 0, -1));// north 28 | neighbors.add(pos.add(0, 0, 1));// south 29 | neighbors.add(pos.add(1, 0, 0));// east 30 | neighbors.add(pos.add(-1, 0, 0));// west 31 | neighbors.add(pos.add(-1, 0, -1));// Add corners 32 | neighbors.add(pos.add(-1, 0, 1)); 33 | neighbors.add(pos.add(1, 0, 1)); 34 | neighbors.add(pos.add(1, 0, -1)); 35 | for (int i = neighbors.size() - 1; i > -1; i--) { 36 | BlockPos neighbor = neighbors.get(i); 37 | if (!PathUtils.isSafe(neighbor, gameInfo) 38 | || !PathUtils.isSafe(neighbor.add(0, 1, 0), gameInfo) 39 | || Math.abs(playerPos.getX() - neighbor.getX()) > 256 40 | || Math.abs(playerPos.getZ() - neighbor.getZ()) > 256) 41 | neighbors.remove(i); 42 | else if (!PathUtils.isFlyable(neighbor, gameInfo)) 43 | if (!PathUtils.isFallable(neighbor, gameInfo)) 44 | neighbors.remove(i); 45 | else if (!gameInfo.isSolid(pos.add(0, -1, 0))) 46 | if (!gameInfo.isSolid(neighbor.add(0, -1, 0))) 47 | neighbors.remove(i); 48 | else if (previous == null 49 | || gameInfo.isSolid(previous.getPos().add(0, -1, 0)) 50 | && previous.getPos().getY() >= pos.getY()) 51 | neighbors.remove(i); 52 | } 53 | neighbors.add(pos.add(0, -1, 0));// down 54 | if (PathUtils.isFlyable(pos, gameInfo) || PathUtils.isClimbable(pos, gameInfo)) 55 | neighbors.add(pos.add(0, 1, 0));// up 56 | return neighbors; 57 | } 58 | 59 | public BlockPos getPos() { 60 | return pos; 61 | } 62 | 63 | public PathPoint getPrevious() { 64 | return previous; 65 | } 66 | 67 | public int getPriority() { 68 | return priority; 69 | } 70 | 71 | public int getMovementCost() { 72 | return movementCost; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/logiccity/minecraft/api/util/PathUtils.java: -------------------------------------------------------------------------------- 1 | package com.logiccity.minecraft.api.util; 2 | 3 | import com.logiccity.minecraft.api.BlockPos; 4 | import com.logiccity.minecraft.api.GameInfo; 5 | 6 | public class PathUtils { 7 | public static boolean isSafe(BlockPos pos, GameInfo gi) { 8 | return (! gi.isSolid(pos)) && gi.isSafeWalkOn(pos.add(0, -1, 0)); 9 | } 10 | 11 | public static boolean isFallable(BlockPos pos, GameInfo gi) { 12 | for (int i = -1; i >= ((gi.isCommandRunning("NoFall") || gi.isCreativeMode()) ? -256 : -3); i--) { 13 | if (gi.isSolid(pos.add(0, i, 0))) { 14 | return true; 15 | } 16 | } 17 | return false; 18 | } 19 | 20 | public static boolean isClimbable(BlockPos pos, GameInfo gi) { 21 | if (gi.isSolid(pos.add(0, -1, 0)) || gi.isLadder(pos)) { 22 | if (gi.isSolid(pos.add(0, 0, -1)) || gi.isSolid(pos.add(0, 0, 1)) 23 | || gi.isSolid(pos.add(1, 0, 0)) 24 | || gi.isSolid(pos.add(-1, 0, 0))) { 25 | return true; 26 | } 27 | } 28 | return false; 29 | } 30 | 31 | public static boolean isFlyable(BlockPos pos, GameInfo gi) { 32 | return gi.isCommandRunning("Flight") || gi.isPlayerFlying() 33 | || gi.isInWater(pos); 34 | } 35 | 36 | public static int getCost(BlockPos next, GameInfo gi) { 37 | if (gi.isInWater(next)) { 38 | return 3; 39 | } 40 | return 1; 41 | } 42 | } 43 | --------------------------------------------------------------------------------