[Change] 1.16.1 -> 1.16.2

This commit is contained in:
CDAGaming
2020-08-13 12:57:59 -05:00
parent 3f3358d0b1
commit 17e16498b6
13 changed files with 39 additions and 33 deletions

View File

@@ -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)

View File

@@ -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:

View File

@@ -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) {

View File

@@ -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());
}
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);
}
}
}