[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

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

View File

@@ -32,7 +32,7 @@ public enum BlockById implements IDatatypeFor<Block> {
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;

View File

@@ -32,7 +32,7 @@ public enum EntityClassById implements IDatatypeFor<EntityType> {
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;

View File

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

View File

@@ -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<String, Block> copy = new HashMap<>(resourceCache); // read only copy is safe, wont throw concurrentmodification
copy.put(name, block);
resourceCache = copy;

View File

@@ -45,11 +45,11 @@ public class MixinCommandSuggestionHelper {
@Shadow
@Final
private TextFieldWidget field_228095_d_;
private TextFieldWidget inputField;
@Shadow
@Final
private List<String> field_228103_l_;
private List<String> exceptionList;
@Shadow
private CompletableFuture<Suggestions> 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<Suggestion> suggestionList = Stream.of(event.completions)
.map(s -> new Suggestion(StringRange.between(offset, offset + s.length()), s))

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