From e49549117bbd29f7349194432184821e436aa247 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 11 Oct 2019 17:08:28 -0700 Subject: [PATCH 1/6] v1.2.10 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d0ba4720a..117f1d63d 100755 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ */ group 'baritone' -version '1.2.9' +version '1.2.10' buildscript { repositories { From 6a8807b0fa1dfe102e13d1dc857a2226164b4412 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 12 Oct 2019 10:43:01 -0700 Subject: [PATCH 2/6] documentation stuff --- README.md | 2 +- USAGE.md | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 19ec0e879..90173889d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ![Lines of Code](https://tokei.rs/b1/github/cabaletta/baritone?category=code) [![GitHub contributors](https://img.shields.io/github/contributors/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/graphs/contributors/) [![GitHub commits](https://img.shields.io/github/commits-since/cabaletta/baritone/v1.0.0.svg)](https://github.com/cabaletta/baritone/commit/) -[![Impact integration](https://img.shields.io/badge/Impact%20integration-v1.2.8%20/%20v1.3.4%20/%20v1.4.1-brightgreen.svg)](https://impactclient.net/) +[![Impact integration](https://img.shields.io/badge/Impact%20integration-v1.2.10%20/%20v1.3.5%20/%20v1.4.2-brightgreen.svg)](https://impactclient.net/) [![ForgeHax integration](https://img.shields.io/badge/ForgeHax%20%22integration%22-scuffed-yellow.svg)](https://github.com/fr1kin/ForgeHax/) [![Aristois add-on integration](https://img.shields.io/badge/Aristois%20add--on%20integration-v1.3.4%20/%20v1.4.1-green.svg)](https://gitlab.com/emc-mods-indrit/baritone_api) [![WWE integration](https://img.shields.io/badge/WWE%20%22integration%22-master%3F-green.svg)](https://wweclient.com/) diff --git a/USAGE.md b/USAGE.md index 25fef11e8..3bca1e769 100644 --- a/USAGE.md +++ b/USAGE.md @@ -8,6 +8,12 @@ Baritone commands can also by default be typed in the chatbox. However if you ma To disable direct chat control (with no prefix), turn off the `chatControl` setting. To disable chat control with the `#` prefix, turn off the `prefixControl` setting. In Impact, `.b` cannot be disabled. Be careful that you don't leave yourself with all control methods disabled (if you do, reset your settings by deleting the file `minecraft/baritone/settings.txt` and relaunching). +# For Baritone 1.2.10+, 1.3.5+, 1.4.2+ + +Lots of the commands have changed, BUT `#help` is improved vastly (its clickable!). + +Try `#help` I promise it won't just send you back here =) + # Commands **All** of these commands may need a prefix before them, as above ^. @@ -38,12 +44,6 @@ Some common examples: - `version` to get the version of Baritone you're running - `damn` daniel - -New commands: -- `sel` to manage selections -- some others - - For the rest of the commands, you can take a look at the code [here](https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/utils/ExampleBaritoneControl.java). All the settings and documentation are here. If you find HTML easier to read than Javadoc, you can look here. From 69bceb43f8c7ed09f22dde7ca67a3632e4006739 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 12 Oct 2019 13:07:12 -0700 Subject: [PATCH 3/6] Update USAGE.md --- USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index 3bca1e769..45dfab571 100644 --- a/USAGE.md +++ b/USAGE.md @@ -10,7 +10,7 @@ To disable direct chat control (with no prefix), turn off the `chatControl` sett # For Baritone 1.2.10+, 1.3.5+, 1.4.2+ -Lots of the commands have changed, BUT `#help` is improved vastly (its clickable!). +Lots of the commands have changed, BUT `#help` is improved vastly (its clickable! commands have tab completion! oh my!). Try `#help` I promise it won't just send you back here =) From 4eca960a4ca0b94b6c2065e7c989af43fecaf70b Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 14 Oct 2019 15:45:41 -0500 Subject: [PATCH 4/6] Specify range in IWorldScanner#repack --- .../java/baritone/api/cache/ICachedWorld.java | 2 - .../baritone/api/cache/IWorldScanner.java | 16 +++++- .../java/baritone/cache/WorldScanner.java | 57 ++++++++++++------- 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/api/java/baritone/api/cache/ICachedWorld.java b/src/api/java/baritone/api/cache/ICachedWorld.java index 837ae076c..e681ce51c 100644 --- a/src/api/java/baritone/api/cache/ICachedWorld.java +++ b/src/api/java/baritone/api/cache/ICachedWorld.java @@ -81,6 +81,4 @@ public interface ICachedWorld { * in a new thread by default. */ void save(); - - } diff --git a/src/api/java/baritone/api/cache/IWorldScanner.java b/src/api/java/baritone/api/cache/IWorldScanner.java index 325d4bd0e..224f64c76 100644 --- a/src/api/java/baritone/api/cache/IWorldScanner.java +++ b/src/api/java/baritone/api/cache/IWorldScanner.java @@ -77,10 +77,20 @@ public interface IWorldScanner { } /** - * Repacks 40 chunks around the player. + * Overload of {@link #repack(IPlayerContext, int)} where the value of the {@code range} parameter is {@code 40}. * - * @param ctx The player context for that player. - * @return The number of chunks queued for repacking. + * @param ctx The player, describing the origin + * @return The amount of chunks successfully queued for repacking */ int repack(IPlayerContext ctx); + + /** + * Queues the chunks in a square formation around the specified player, using the specified + * range, which represents 1/2 the square's dimensions, where the player is in the center. + * + * @param ctx The player, describing the origin + * @param range The range to repack + * @return The amount of chunks successfully queued for repacking + */ + int repack(IPlayerContext ctx, int range); } diff --git a/src/main/java/baritone/cache/WorldScanner.java b/src/main/java/baritone/cache/WorldScanner.java index d31c17ab3..362506298 100644 --- a/src/main/java/baritone/cache/WorldScanner.java +++ b/src/main/java/baritone/cache/WorldScanner.java @@ -111,6 +111,41 @@ public enum WorldScanner implements IWorldScanner { return res; } + @Override + public int repack(IPlayerContext ctx) { + return this.repack(ctx, 40); + } + + @Override + public int repack(IPlayerContext ctx, int range) { + IChunkProvider chunkProvider = ctx.world().getChunkProvider(); + ICachedWorld cachedWorld = ctx.worldData().getCachedWorld(); + + BetterBlockPos playerPos = ctx.playerFeet(); + + int playerChunkX = playerPos.getX() >> 4; + int playerChunkZ = playerPos.getZ() >> 4; + + int minX = playerChunkX - range; + int minZ = playerChunkZ - range; + int maxX = playerChunkX + range; + int maxZ = playerChunkZ + range; + + int queued = 0; + for (int x = minX; x <= maxX; x++) { + for (int z = minZ; z <= maxZ; z++) { + Chunk chunk = chunkProvider.getLoadedChunk(x, z); + + if (chunk != null && !chunk.isEmpty()) { + queued++; + cachedWorld.queueForPacking(chunk); + } + } + } + + return queued; + } + private boolean scanChunkInto(int chunkX, int chunkZ, Chunk chunk, BlockOptionalMetaLookup filter, Collection result, int max, int yLevelThreshold, int playerY, int[] coordinateIterationOrder) { ExtendedBlockStorage[] chunkInternalStorageArray = chunk.getBlockStorageArray(); boolean foundWithinY = false; @@ -147,26 +182,4 @@ public enum WorldScanner implements IWorldScanner { } return foundWithinY; } - - public int repack(IPlayerContext ctx) { - IChunkProvider chunkProvider = ctx.world().getChunkProvider(); - ICachedWorld cachedWorld = ctx.worldData().getCachedWorld(); - - BetterBlockPos playerPos = ctx.playerFeet(); - int playerChunkX = playerPos.getX() >> 4; - int playerChunkZ = playerPos.getZ() >> 4; - int queued = 0; - for (int x = playerChunkX - 40; x <= playerChunkX + 40; x++) { - for (int z = playerChunkZ - 40; z <= playerChunkZ + 40; z++) { - Chunk chunk = chunkProvider.getLoadedChunk(x, z); - - if (chunk != null && !chunk.isEmpty()) { - queued++; - cachedWorld.queueForPacking(chunk); - } - } - } - - return queued; - } } From e65c854e6a0822dbc2559620e602beb6920b561d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 15 Oct 2019 11:25:35 -0700 Subject: [PATCH 5/6] Update USAGE.md --- USAGE.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index 45dfab571..118104993 100644 --- a/USAGE.md +++ b/USAGE.md @@ -14,11 +14,17 @@ Lots of the commands have changed, BUT `#help` is improved vastly (its clickable Try `#help` I promise it won't just send you back here =) +"wtf where is cleararea" -> look at `#help sel` + +"wtf where is goto death, goto waypoint" -> look at `#help wp` + +just look at `#help` lmao + # Commands **All** of these commands may need a prefix before them, as above ^. -`help` for (rudimentary) help. You can see what it says [here](https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/utils/ExampleBaritoneControl.java#L47). +`help` To toggle a boolean setting, just say its name in chat (for example saying `allowBreak` toggles whether Baritone will consider breaking blocks). For a numeric setting, say its name then the new value (like `primaryTimeoutMS 250`). It's case insensitive. To reset a setting to its default value, say `acceptableThrowawayItems reset`. To reset all settings, say `reset`. To see all settings that have been modified from their default values, say `modified`. From 66ffd1e0d9acb68b5b3b13a112522cd88b6d76db Mon Sep 17 00:00:00 2001 From: 0x22 <0x22@futureclient.net> Date: Thu, 17 Oct 2019 14:35:28 -0400 Subject: [PATCH 6/6] Disable harmful mob spawning in Travis auto test. --- .../java/baritone/utils/BaritoneAutoTest.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/baritone/utils/BaritoneAutoTest.java b/src/main/java/baritone/utils/BaritoneAutoTest.java index a723ebc53..7fe913ac4 100644 --- a/src/main/java/baritone/utils/BaritoneAutoTest.java +++ b/src/main/java/baritone/utils/BaritoneAutoTest.java @@ -29,9 +29,7 @@ import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.tutorial.TutorialSteps; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.GameType; -import net.minecraft.world.WorldSettings; -import net.minecraft.world.WorldType; +import net.minecraft.world.*; /** * Responsible for automatically testing Baritone's pathing algorithm by automatically creating a world with a specific @@ -85,15 +83,21 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper { if (mc.currentScreen instanceof GuiMainMenu) { System.out.println("Beginning Baritone automatic test routine"); mc.displayGuiScreen(null); - WorldSettings worldsettings = new WorldSettings(TEST_SEED, GameType.getByName("survival"), true, false, WorldType.DEFAULT); + WorldSettings worldsettings = new WorldSettings(TEST_SEED, GameType.SURVIVAL, true, false, WorldType.DEFAULT); mc.launchIntegratedServer("BaritoneAutoTest", "BaritoneAutoTest", worldsettings); } - // If the integrated server is launched and the world has initialized, set the spawn point - // to our defined starting position - if (mc.getIntegratedServer() != null && mc.getIntegratedServer().worlds[0] != null) { - mc.getIntegratedServer().worlds[0].setSpawnPoint(STARTING_POSITION); - mc.getIntegratedServer().worlds[0].getGameRules().setOrCreateGameRule("spawnRadius", "0"); + // If the integrated server is running, set the difficulty to peaceful + if (mc.getIntegratedServer() != null) { + mc.getIntegratedServer().setDifficultyForAllWorlds(EnumDifficulty.PEACEFUL); + + for (final WorldServer world : mc.getIntegratedServer().worlds) { + // If the world has initialized, set the spawn point to our defined starting position + if (world != null) { + world.setSpawnPoint(STARTING_POSITION); + world.getGameRules().setOrCreateGameRule("spawnRadius", "0"); + } + } } if (event.getType() == TickEvent.Type.IN) { // If we're in-game @@ -101,7 +105,7 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper { // Force the integrated server to share the world to LAN so that // the ingame pause menu gui doesn't actually pause our game if (mc.isSingleplayer() && !mc.getIntegratedServer().getPublic()) { - mc.getIntegratedServer().shareToLAN(GameType.getByName("survival"), false); + mc.getIntegratedServer().shareToLAN(GameType.SURVIVAL, false); } // For the first 200 ticks, wait for the world to generate