diff --git a/build.gradle b/build.gradle index f92ec606f..b510fa3e2 100755 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ */ group 'baritone' -version '1.6.1' +version '1.6.2' buildscript { repositories { @@ -24,6 +24,9 @@ buildscript { name = 'forge' url = 'http://files.minecraftforge.net/maven' } + maven { + url = 'https://www.dogforce-games.com/maven/' + } maven { name = 'impactdevelopment-repo' url = 'https://impactdevelopment.github.io/maven/' @@ -85,7 +88,7 @@ task sourceJar(type: Jar, dependsOn: classes) { } minecraft { - mappings channel: 'snapshot', version: '20200723-1.16.1' + mappings channel: 'snapshot', version: '20200813-1.16.1' if (getProject().hasProperty("baritone.forge_build")) { reobfMappings 'searge' @@ -138,7 +141,9 @@ repositories { name = 'spongepowered-repo' url = 'http://repo.spongepowered.org/maven/' } - + maven { + url = 'https://www.dogforce-games.com/maven/' + } maven { name = 'impactdevelopment-repo' url = 'https://impactdevelopment.github.io/maven/' @@ -146,7 +151,7 @@ repositories { } dependencies { - minecraft 'com.github.ImpactDevelopment:Vanilla:1.16.1' + minecraft 'com.github.ImpactDevelopment:Vanilla:1.16.2' runtime launchCompile('net.minecraft:launchwrapper:1.12') { exclude module: 'lwjgl' diff --git a/src/api/java/baritone/api/command/datatypes/BlockById.java b/src/api/java/baritone/api/command/datatypes/BlockById.java index 113238df0..0c8270193 100644 --- a/src/api/java/baritone/api/command/datatypes/BlockById.java +++ b/src/api/java/baritone/api/command/datatypes/BlockById.java @@ -32,7 +32,7 @@ public enum BlockById implements IDatatypeFor { public Block get(IDatatypeContext ctx) throws CommandException { ResourceLocation id = new ResourceLocation(ctx.getConsumer().getString()); Block block; - if ((block = Registry.BLOCK.getValue(id).orElse(null)) == null) { + if ((block = Registry.BLOCK.func_241873_b(id).orElse(null)) == null) { throw new IllegalArgumentException("no block found by that id"); } return block; diff --git a/src/api/java/baritone/api/command/datatypes/EntityClassById.java b/src/api/java/baritone/api/command/datatypes/EntityClassById.java index 763815f0f..71870ef2e 100644 --- a/src/api/java/baritone/api/command/datatypes/EntityClassById.java +++ b/src/api/java/baritone/api/command/datatypes/EntityClassById.java @@ -32,7 +32,7 @@ public enum EntityClassById implements IDatatypeFor { public EntityType get(IDatatypeContext ctx) throws CommandException { ResourceLocation id = new ResourceLocation(ctx.getConsumer().getString()); EntityType entity; - if ((entity = Registry.ENTITY_TYPE.getValue(id).orElse(null)) == null) { + if ((entity = Registry.ENTITY_TYPE.func_241873_b(id).orElse(null)) == null) { throw new IllegalArgumentException("no entity found by that id"); } return entity; diff --git a/src/api/java/baritone/api/utils/BlockOptionalMeta.java b/src/api/java/baritone/api/utils/BlockOptionalMeta.java index 3fa7778cf..4abd9087c 100644 --- a/src/api/java/baritone/api/utils/BlockOptionalMeta.java +++ b/src/api/java/baritone/api/utils/BlockOptionalMeta.java @@ -29,6 +29,7 @@ import net.minecraft.resources.*; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Unit; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.vector.Vector3d; import javax.annotation.Nonnull; import java.util.*; @@ -132,7 +133,7 @@ public final class BlockOptionalMeta { public static LootTableManager getManager() { if (manager == null) { - ResourcePackList rpl = new ResourcePackList<>(ResourcePackInfo::new, new ServerPackFinder()); + ResourcePackList rpl = new ResourcePackList(ResourcePackInfo::new, new ServerPackFinder()); rpl.reloadPacksFromFinders(); IResourcePack thePack = rpl.getAllPacks().iterator().next().getResourcePack(); IReloadableResourceManager resourceManager = new SimpleReloadableResourceManager(ResourcePackType.SERVER_DATA); @@ -163,7 +164,7 @@ public final class BlockOptionalMeta { getManager().getLootTableFromLocation(lootTableLocation).generate( new LootContext.Builder(null) .withRandom(new Random()) - .withParameter(LootParameters.POSITION, BlockPos.ZERO) + .withParameter(LootParameters.field_237457_g_, Vector3d.copy(BlockPos.NULL_VECTOR)) .withParameter(LootParameters.TOOL, ItemStack.EMPTY) .withNullableParameter(LootParameters.BLOCK_ENTITY, null) .withParameter(LootParameters.BLOCK_STATE, block.getDefaultState()) diff --git a/src/api/java/baritone/api/utils/BlockUtils.java b/src/api/java/baritone/api/utils/BlockUtils.java index d6ef34f3d..3ee95f6af 100644 --- a/src/api/java/baritone/api/utils/BlockUtils.java +++ b/src/api/java/baritone/api/utils/BlockUtils.java @@ -57,7 +57,7 @@ public class BlockUtils { if (resourceCache.containsKey(name)) { return null; // cached as null } - block = Registry.BLOCK.getValue(ResourceLocation.tryCreate(name.contains(":") ? name : "minecraft:" + name)).orElse(null); + block = Registry.BLOCK.func_241873_b(ResourceLocation.tryCreate(name.contains(":") ? name : "minecraft:" + name)).orElse(null); Map copy = new HashMap<>(resourceCache); // read only copy is safe, wont throw concurrentmodification copy.put(name, block); resourceCache = copy; diff --git a/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java b/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java index 06abfd674..00497ab6b 100644 --- a/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java +++ b/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java @@ -45,11 +45,11 @@ public class MixinCommandSuggestionHelper { @Shadow @Final - private TextFieldWidget field_228095_d_; + private TextFieldWidget inputField; @Shadow @Final - private List field_228103_l_; + private List exceptionList; @Shadow private CompletableFuture suggestionsFuture; @@ -61,7 +61,7 @@ public class MixinCommandSuggestionHelper { ) private void preUpdateSuggestion(CallbackInfo ci) { // Anything that is present in the input text before the cursor position - String prefix = this.field_228095_d_.getText().substring(0, Math.min(this.field_228095_d_.getText().length(), this.field_228095_d_.getCursorPosition())); + String prefix = this.inputField.getText().substring(0, Math.min(this.inputField.getText().length(), this.inputField.getCursorPosition())); TabCompleteEvent event = new TabCompleteEvent(prefix); BaritoneAPI.getProvider().getPrimaryBaritone().getGameEventHandler().onPreTabComplete(event); @@ -75,14 +75,14 @@ public class MixinCommandSuggestionHelper { ci.cancel(); // TODO: Support populating the command usage - this.field_228103_l_.clear(); + this.exceptionList.clear(); if (event.completions.length == 0) { this.suggestionsFuture = Suggestions.empty(); } else { - int offset = this.field_228095_d_.getText().endsWith(" ") - ? this.field_228095_d_.getCursorPosition() - : this.field_228095_d_.getText().lastIndexOf(" ") + 1; // If there is no space this is still 0 haha yes + int offset = this.inputField.getText().endsWith(" ") + ? this.inputField.getCursorPosition() + : this.inputField.getText().lastIndexOf(" ") + 1; // If there is no space this is still 0 haha yes List suggestionList = Stream.of(event.completions) .map(s -> new Suggestion(StringRange.between(offset, offset + s.length()), s)) diff --git a/src/main/java/baritone/cache/CachedChunk.java b/src/main/java/baritone/cache/CachedChunk.java index 0c931cefe..556a7e3c4 100644 --- a/src/main/java/baritone/cache/CachedChunk.java +++ b/src/main/java/baritone/cache/CachedChunk.java @@ -202,11 +202,11 @@ public final class CachedChunk { } if (type == PathingBlockType.SOLID) { - if (y == 127 && dimension == World.field_234919_h_) { + if (y == 127 && dimension == World.THE_NETHER) { // nether roof is always unbreakable return Blocks.BEDROCK.getDefaultState(); } - if (y < 5 && dimension == World.field_234918_g_) { + if (y < 5 && dimension == World.OVERWORLD) { // solid blocks below 5 are commonly bedrock // however, returning bedrock always would be a little yikes // discourage paths that include breaking blocks below 5 a little more heavily just so that it takes paths breaking what's known to be stone (at 5 or above) instead of what could maybe be bedrock (below 5) diff --git a/src/main/java/baritone/cache/ChunkPacker.java b/src/main/java/baritone/cache/ChunkPacker.java index 214a9b91c..4791ad781 100644 --- a/src/main/java/baritone/cache/ChunkPacker.java +++ b/src/main/java/baritone/cache/ChunkPacker.java @@ -158,13 +158,13 @@ public final class ChunkPacker { return Blocks.LAVA.getDefaultState(); case SOLID: // Dimension solid types - if (dimension == World.field_234918_g_) { + if (dimension == World.OVERWORLD) { return Blocks.STONE.getDefaultState(); } - if (dimension == World.field_234919_h_) { + if (dimension == World.THE_NETHER) { return Blocks.NETHERRACK.getDefaultState(); } - if (dimension == World.field_234920_i_) { + if (dimension == World.THE_END) { return Blocks.END_STONE.getDefaultState(); } default: diff --git a/src/main/java/baritone/cache/WorldProvider.java b/src/main/java/baritone/cache/WorldProvider.java index b56c0fdf8..ac0ba2070 100644 --- a/src/main/java/baritone/cache/WorldProvider.java +++ b/src/main/java/baritone/cache/WorldProvider.java @@ -64,7 +64,7 @@ public class WorldProvider implements IWorldProvider, Helper { // If there is an integrated server running (Aka Singleplayer) then do magic to find the world save file if (mc.isSingleplayer()) { - directory = DimensionType.func_236031_a_(world, integratedServer.func_240776_a_(FolderName.field_237253_i_).toFile()); + directory = DimensionType.func_236031_a_(world, integratedServer.func_240776_a_(FolderName.DOT).toFile()); // Gets the "depth" of this directory relative the the game's run directory, 2 is the location of the world if (directory.toPath().relativize(mc.gameDir.toPath()).getNameCount() != 2) { diff --git a/src/main/java/baritone/event/GameEventHandler.java b/src/main/java/baritone/event/GameEventHandler.java index 148f7c913..eff8689b5 100644 --- a/src/main/java/baritone/event/GameEventHandler.java +++ b/src/main/java/baritone/event/GameEventHandler.java @@ -115,7 +115,7 @@ public final class GameEventHandler implements IEventBus, Helper { if (event.getState() == EventState.POST) { cache.closeWorld(); if (event.getWorld() != null) { - cache.initWorld(event.getWorld().func_234923_W_()); + cache.initWorld(event.getWorld().getDimensionKey()); } } diff --git a/src/main/java/baritone/pathing/movement/CalculationContext.java b/src/main/java/baritone/pathing/movement/CalculationContext.java index 260e403af..d47569b47 100644 --- a/src/main/java/baritone/pathing/movement/CalculationContext.java +++ b/src/main/java/baritone/pathing/movement/CalculationContext.java @@ -32,7 +32,6 @@ import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.DimensionType; import net.minecraft.world.World; import static baritone.api.pathing.movement.ActionCosts.COST_INF; @@ -86,7 +85,7 @@ public class CalculationContext { this.bsi = new BlockStateInterface(world, worldData, forUseOnAnotherThread); this.toolSet = new ToolSet(player); this.hasThrowaway = Baritone.settings().allowPlace.value && ((Baritone) baritone).getInventoryBehavior().hasGenericThrowaway(); - this.hasWaterBucket = Baritone.settings().allowWaterBucketFall.value && PlayerInventory.isHotbar(player.inventory.getSlotFor(STACK_BUCKET_WATER)) && world.func_234922_V_() != DimensionType.THE_NETHER; + this.hasWaterBucket = Baritone.settings().allowWaterBucketFall.value && PlayerInventory.isHotbar(player.inventory.getSlotFor(STACK_BUCKET_WATER)) && world.getDimensionKey() != World.THE_NETHER; this.canSprint = Baritone.settings().allowSprint.value && player.getFoodStats().getFoodLevel() > 6; this.placeBlockCost = Baritone.settings().blockPlacementPenalty.value; this.allowBreak = Baritone.settings().allowBreak.value; diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index da36ac5f8..9d36c4b5a 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -42,7 +42,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3i; -import net.minecraft.world.DimensionType; +import net.minecraft.world.World; import java.util.HashSet; import java.util.Optional; @@ -97,7 +97,7 @@ public class MovementFall extends Movement { Block destBlock = destState.getBlock(); boolean isWater = destState.getFluidState().getFluid() instanceof WaterFluid; if (!isWater && willPlaceBucket() && !playerFeet.equals(dest)) { - if (!PlayerInventory.isHotbar(ctx.player().inventory.getSlotFor(STACK_BUCKET_WATER)) || ctx.world().func_234922_V_() == DimensionType.THE_NETHER) { + if (!PlayerInventory.isHotbar(ctx.player().inventory.getSlotFor(STACK_BUCKET_WATER)) || ctx.world().getDimensionKey() == World.THE_NETHER) { return state.setStatus(MovementStatus.UNREACHABLE); } diff --git a/src/main/java/baritone/utils/BaritoneAutoTest.java b/src/main/java/baritone/utils/BaritoneAutoTest.java index a54e85fa1..bc72a3627 100644 --- a/src/main/java/baritone/utils/BaritoneAutoTest.java +++ b/src/main/java/baritone/utils/BaritoneAutoTest.java @@ -32,11 +32,11 @@ import net.minecraft.client.settings.CloudOption; import net.minecraft.client.settings.GraphicsFanciness; import net.minecraft.client.settings.ParticleStatus; import net.minecraft.client.tutorial.TutorialSteps; -import net.minecraft.server.IDynamicRegistries; import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.util.HTTPUtil; import net.minecraft.util.datafix.codec.DatapackCodec; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.registry.DynamicRegistries; import net.minecraft.world.*; import net.minecraft.world.gen.settings.DimensionGeneratorSettings; import net.minecraft.world.server.ServerWorld; @@ -85,7 +85,7 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper { s.chatScale = 0.0F; s.ambientOcclusionStatus = AmbientOcclusionStatus.OFF; s.cloudOption = CloudOption.OFF; - s.field_238330_f_ = GraphicsFanciness.FAST; + s.graphicFanciness = GraphicsFanciness.FAST; s.tutorialStep = TutorialSteps.NONE; s.hideGUI = true; s.fov = 30.0F; @@ -99,18 +99,19 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper { System.out.println("Beginning Baritone automatic test routine"); mc.displayGuiScreen(null); WorldSettings worldsettings = new WorldSettings("BaritoneAutoTest", GameType.SURVIVAL, false, Difficulty.NORMAL, true, new GameRules(), DatapackCodec.field_234880_a_); - mc.func_238192_a_("BaritoneAutoTest", worldsettings, IDynamicRegistries.func_239770_b_(), DimensionGeneratorSettings.field_236202_b_.create(false, OptionalLong.of(TEST_SEED))); + final DynamicRegistries.Impl impl = DynamicRegistries.func_239770_b_(); + mc.func_238192_a_("BaritoneAutoTest", worldsettings, impl, DimensionGeneratorSettings.func_242752_a(impl).create(false, OptionalLong.of(TEST_SEED))); } IntegratedServer server = mc.getIntegratedServer(); // If the integrated server is launched and the world has initialized, set the spawn point // to our defined starting position - if (server != null && server.getWorld(World.field_234918_g_) != null) { + if (server != null && server.getWorld(World.OVERWORLD) != null) { server.setDifficultyForAllWorlds(Difficulty.PEACEFUL, true); if (mc.player == null) { server.execute(() -> { - server.getWorld(World.field_234918_g_).func_241124_a__(STARTING_POSITION); + server.getWorld(World.OVERWORLD).func_241124_a__(STARTING_POSITION, 0.0f); server.getCommandManager().handleCommand(server.getCommandSource(), "/difficulty peaceful"); int result = server.getCommandManager().handleCommand(server.getCommandSource(), "/gamerule spawnRadius 0"); if (result != 0) { @@ -121,7 +122,7 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper { // If the world has initialized, set the spawn point to our defined starting position if (world != null) { world.getGameRules().get(GameRules.SPAWN_RADIUS).func_234909_b_("0"); - world.func_241124_a__(STARTING_POSITION); + world.func_241124_a__(STARTING_POSITION, 0.0f); } } }