Compare commits

..

43 Commits

Author SHA1 Message Date
ZacSharp
42bb44120d Merge branch '1.20.4' into 1.20.6 2025-05-13 13:46:05 +02:00
ZacSharp
ac1e0e7d6b Merge branch '1.20.2' into 1.20.4 2025-05-13 13:41:44 +02:00
leijurv
0de802e7ba Merge pull request #4727 from ZacSharp/pr/1.20.4/misc/backportSelectionAabbAndMixinFix
Backport #4465 and #4396 to 1.20.4
2025-05-04 18:45:33 -07:00
Wagyourtail
249f93877c fix neoforge and forge for 1.20.4
cherry picked, squashed and adapted from commits 74d82f2339 and 81f7375591
2025-04-27 01:26:58 +02:00
ZacSharp
8ac57c8da3 Fix selection box aabbs
(cherry picked from commit e682fc75a6)
2025-04-26 23:24:24 +02:00
ZacSharp
d79f7f9615 Merge branch '1.20.4' into 1.20.6 2025-04-23 00:00:53 +02:00
ZacSharp
db96a5a3ec Merge branch '1.20.2' into 1.20.4 2025-04-22 23:47:58 +02:00
leijurv
290e697d4a Merge pull request #4565 from ZacSharp/1.20.5-update
Merge 1.19.4 into 1.20.5
2024-11-30 18:03:48 -06:00
ZacSharp
a5752507e1 Merge branch '1.19.4' into 1.20.5 2024-11-21 09:53:15 +01:00
leijurv
1bfc0305fd Merge pull request #4553 from rfresh2/packLoadFix-1.20.5
Fix registry loading when custom registries present
2024-11-20 20:02:31 -08:00
rfresh2
81c53d5db1 only load vanilla pack for registry access 2024-11-08 23:44:55 -08:00
leijurv
b550b92b0a Merge pull request #4527 from ZacSharp/1.20.5-update
Merge 1.19.4 into 1.20.5
2024-10-22 15:53:06 -07:00
ZacSharp
28695031d7 Merge branch '1.19.4' into 1.20.5 2024-10-22 14:50:47 +02:00
leijurv
800545f0b5 Merge pull request #4465 from ZacSharp/pr/1.20.6/selection/fixSelectionAABB
Fix selection box aabbs
2024-08-22 11:01:45 -07:00
ZacSharp
e682fc75a6 Fix selection box aabbs 2024-08-09 13:54:29 +02:00
leijurv
acdcbf5146 Merge pull request #4439 from ZacSharp/1.20.5-update
Merge 1.19.4 into 1.20.5
2024-07-28 00:39:51 -07:00
ZacSharp
6b2fd5acee Merge branch '1.19.4' into 1.20.5 2024-07-21 13:02:03 +02:00
leijurv
1704d56274 Merge pull request #4396 from wagyourtail/1.20/1.20.5-(neo)forge
fix neoforge and forge for 1.20.5+
2024-06-19 18:20:49 -07:00
Wagyourtail
81f7375591 fix mixin eating my try-catch 2024-06-17 00:26:34 -05:00
Wagyourtail
74d82f2339 fix neoforge and forge for 1.20.5+ 2024-06-17 00:11:11 -05:00
leijurv
42c6abbf72 Merge pull request #4347 from wagyourtail/1.20/1.20.5
1.20.5/6
2024-06-07 00:45:20 -07:00
William Gray
8bb19797e1 Update neoforge/src/main/resources/META-INF/neoforge.mods.toml
Co-authored-by: ZacSharp <68165024+ZacSharp@users.noreply.github.com>
2024-05-27 05:13:47 -06:00
Wagyourtail
6b274b3f1e just work already 2024-05-07 13:25:34 -05:00
Wagyourtail
f02c3115d1 update proguard 2024-05-07 13:19:12 -05:00
Wagyourtail
ee9ca6dd49 fix gradle version not supporting 21 2024-05-07 13:10:54 -05:00
Wagyourtail
8a5e3f7009 fix unfixable conflicts 2024-05-07 13:07:02 -05:00
Wagyourtail
b29878d0f2 fix neoforge version 2024-05-07 13:04:28 -05:00
Wagyourtail
19c8194eae re-enable lexforge 2024-05-07 13:02:58 -05:00
Wagyourtail
d8381c71fd rebuild loot tables 2024-05-07 13:00:32 -05:00
Wagyourtail
4b76fa995c java 21 2024-04-28 09:59:04 -05:00
Wagyourtail
088056b3d0 port to 1.20.5 2024-04-28 08:32:18 -05:00
leijurv
1018db797e Merge pull request #4315 from ZacSharp/1.20.4-update
Merge 1.19.4 into 1.20.4
2024-04-24 12:49:27 -07:00
ZacSharp
354b26b1da Merge branch '1.19.4' into 1.20.4 2024-03-29 03:30:39 +01:00
leijurv
6d06713610 Merge pull request #4280 from ZacSharp/1.20.4-update
Merge 1.19.4 into 1.20.4
2024-03-28 16:51:28 -07:00
ZacSharp
980d68536c Merge branch '1.19.4' into 1.20.4 2024-02-20 15:24:50 +01:00
Leijurv
8a0f3018bf v1.10.2 2024-01-06 11:28:46 -08:00
leijurv
3e7eb87a36 Merge pull request #4214 from wagyourtail/1.20/1.20.4
1.20.4
2024-01-06 09:26:22 -10:00
Wagyourtail
c146440cb2 mark 1.20.3 as supported 2023-12-17 03:36:23 -07:00
Wagyourtail
4b6652b4cf 1.20.4 2023-12-07 14:18:39 -07:00
Wagyourtail
21feeb664e fix missing function 2023-11-23 19:31:55 -07:00
Wagyourtail
3dbcf0102a fix forge version 2023-11-23 19:14:10 -07:00
Wagyourtail
c1b555c289 bump parchment 2023-11-23 19:11:39 -07:00
Wagyourtail
dce35e339f Merge remote-tracking branch 'origin/1.19.4' into 1.20.2 2023-11-23 19:06:07 -07:00
35 changed files with 497 additions and 148 deletions

View File

@@ -17,10 +17,10 @@ jobs:
with:
fetch-depth: 0
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: gradle

View File

@@ -12,10 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for gradlew

View File

@@ -82,6 +82,8 @@ allprojects {
compileOnly "org.ow2.asm:asm:${project.asm_version}"
implementation "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
implementation 'com.google.code.findbugs:jsr305:3.0.2'
}
unimined.minecraft(sourceSets.main, true) {
@@ -90,7 +92,9 @@ allprojects {
mappings {
intermediary()
mojmap()
parchment("2023.10.22")
parchment("1.20.6", "2024.05.01")
devFallbackNamespace "official"
}
}

View File

@@ -40,5 +40,5 @@ dependencies {
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
implementation group: 'commons-io', name: 'commons-io', version: '2.7'
implementation group: 'xyz.wagyourtail.unimined', name: 'xyz.wagyourtail.unimined.gradle.plugin', version: '1.0.5'
implementation group: 'xyz.wagyourtail.unimined', name: 'xyz.wagyourtail.unimined.gradle.plugin', version: '1.2.9'
}

View File

@@ -78,7 +78,7 @@ components.java {
}
task proguard(type: ProguardTask) {
proguardVersion "7.2.1"
proguardVersion "7.4.2"
compType "fabric"
}

View File

@@ -1,4 +1,3 @@
{
"schemaVersion": 1,
"id": "baritone",
@@ -27,7 +26,7 @@
"depends": {
"fabricloader": ">=0.14.22",
"minecraft": "1.20.2"
"minecraft": ["1.20.5", "1.20.6"]
},
"custom": {
"modmenu": {

View File

@@ -25,11 +25,7 @@ plugins {
archivesBaseName = archivesBaseName + "-forge"
unimined.minecraft {
mappings {
devFallbackNamespace "intermediary"
}
forge {
minecraftForge {
loader project.forge_version
mixinConfig ["mixins.baritone.json"]
}
@@ -99,7 +95,7 @@ components.java {
}
task proguard(type: ProguardTask) {
proguardVersion "7.2.1"
proguardVersion "7.4.2"
compType "forge"
}

View File

@@ -35,6 +35,6 @@ A Minecraft pathfinder bot.
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.20.2]"
versionRange="[1.20.5, 1.20.6]"
ordering="NONE"
side="BOTH"

View File

@@ -1,22 +1,24 @@
org.gradle.jvmargs=-Xmx4G
available_loaders=fabric,forge,tweaker
available_loaders=fabric,forge,neoforge,tweaker
mod_version=1.10.2
maven_group=baritone
archives_base_name=baritone
java_version=17
java_version=21
minecraft_version=1.20.2
minecraft_version=1.20.6
forge_version=48.0.1
forge_version=50.0.8
fabric_version=0.14.22
neoforge_version=43-beta
fabric_version=0.15.11
nether_pathfinder_version=1.4.1
// These dependencies are used for common and tweaker
// while mod loaders usually ship their own version
mixin_version=0.8.5
asm_version=9.3
asm_version=9.7

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

130
neoforge/build.gradle Normal file
View File

@@ -0,0 +1,130 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
import baritone.gradle.task.CreateDistTask
import baritone.gradle.task.ProguardTask
plugins {
id "com.github.johnrengelman.shadow" version "8.0.0"
}
archivesBaseName = archivesBaseName + "-neoforge"
unimined.minecraft {
neoForged {
loader project.neoforge_version
mixinConfig ["mixins.baritone.json"]
}
minecraftRemapper.config {
// neoforge adds 1 conflict, where 2 interfaces have a method with the same name on yarn/mojmap,
// but the method has different names in the intermediary mappings.
// this is a conflict because they have a class that extends both interfaces.
// this shouldn't be a problem as long as named mappings don't make the name of those 2 methods different.
ignoreConflicts(true)
}
}
//loom {
// forge {
// mixinConfig 'mixins.baritone.json'
// }
//}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
}
dependencies {
// because of multiple sourcesets `common project(":")` doesn't work
for (sourceSet in rootProject.sourceSets) {
if (sourceSet == rootProject.sourceSets.test) continue
if (sourceSet == rootProject.sourceSets.schematica_api) continue
common sourceSet.output
shadowCommon sourceSet.output
}
shadowCommon "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("META-INF/neoforge.mods.toml") {
expand "version": project.version
}
}
shadowJar {
configurations = [project.configurations.shadowCommon]
archiveClassifier.set "dev-shadow"
}
remapJar {
inputFile.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set null
}
jar {
archiveClassifier.set "dev"
manifest {
attributes(
'MixinConfigs': 'mixins.baritone.json',
"MixinConnector": "baritone.launch.BaritoneMixinConnector",
'Implementation-Title': 'Baritone',
'Implementation-Version': version,
)
}
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
task proguard(type: ProguardTask) {
proguardVersion "7.4.2"
compType "neoforge"
}
task createDist(type: CreateDistTask, dependsOn: proguard) {
compType "neoforge"
}
build.finalizedBy(createDist)
publishing {
publications {
mavenFabric(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}

View File

@@ -0,0 +1,18 @@
#
# This file is part of Baritone.
#
# Baritone is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Baritone is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Baritone. If not, see <https://www.gnu.org/licenses/>.
#
loom.platform=forge

View File

@@ -0,0 +1,24 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.launch;
import net.neoforged.fml.common.Mod;
@Mod("baritoe")
public class BaritoneForgeModXD {
}

View File

@@ -0,0 +1,40 @@
# This is an example neoforge.mods.toml file. It contains the data relating to the loading mods.
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
# The overall format is standard TOML format, v0.5.0.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here: https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[1,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
license="https://raw.githubusercontent.com/cabaletta/baritone/1.16.2/LICENSE"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="https://github.com/cabaletta/baritone/issues" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="baritoe" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="${version}" #mandatory
# A display name for the mod
displayName="Baritone" #mandatory
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="https://github.com/cabaletta/baritone" #optional
# A file name (in the root of the mod JAR) containing a logo for display
#logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Hat Gamers" #optional
# A text field displayed in the mod UI
authors="leijurv, Brady" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
A Minecraft pathfinder bot.
'''
[[dependencies.baritoe]]
modId="minecraft"
type="required"
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.20.5, 1.20.6]"
ordering="NONE"
side="BOTH"

View File

@@ -0,0 +1,6 @@
{
"pack": {
"description": "null",
"pack_format": 8
}
}

View File

@@ -18,28 +18,41 @@
package baritone.api.utils;
import baritone.api.utils.accessor.IItemStack;
import baritone.api.utils.accessor.ILootTable;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.netty.util.concurrent.ThreadPerTaskExecutor;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.commands.Commands;
import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.RegistryDataLoader;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.RegistryLayer;
import net.minecraft.server.ReloadableServerRegistries;
import net.minecraft.server.ReloadableServerResources;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.VanillaPackResources;
import net.minecraft.server.packs.repository.BuiltInPackSource;
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.ServerPacksSource;
import net.minecraft.server.packs.resources.CloseableResourceManager;
import net.minecraft.server.packs.resources.MultiPackResourceManager;
import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.minecraft.util.Unit;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.world.RandomSequences;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.CustomSpawner;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.WorldDataConfiguration;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.Property;
@@ -48,8 +61,8 @@ import net.minecraft.world.level.storage.LevelStorageSource;
import net.minecraft.world.level.storage.ServerLevelData;
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootDataManager;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.Vec3;
@@ -75,7 +88,6 @@ public final class BlockOptionalMeta {
private final Set<BlockState> blockstates;
private final ImmutableSet<Integer> stateHashes;
private final ImmutableSet<Integer> stackHashes;
private static LootDataManager lootTables;
private static Map<Block, List<Item>> drops = new HashMap<>();
public BlockOptionalMeta(@Nonnull Block block) {
@@ -218,43 +230,21 @@ public final class BlockOptionalMeta {
return null;
}
public static LootDataManager getManager() {
if (lootTables == null) {
MultiPackResourceManager resources = new MultiPackResourceManager(PackType.SERVER_DATA, List.of(getVanillaServerPack()));
ReloadableResourceManager resourceManager = new ReloadableResourceManager(PackType.SERVER_DATA);
lootTables = new LootDataManager();
resourceManager.registerReloadListener(lootTables);
try {
resourceManager.createReload(new ThreadPerTaskExecutor(Thread::new), new ThreadPerTaskExecutor(Thread::new), CompletableFuture.completedFuture(Unit.INSTANCE), resources.listPacks().toList()).done().get();
} catch (Exception exception) {
throw new RuntimeException(exception);
}
}
return lootTables;
}
private static synchronized List<Item> drops(Block b) {
return drops.computeIfAbsent(b, block -> {
ResourceLocation lootTableLocation = block.getLootTable();
if (lootTableLocation == BuiltInLootTables.EMPTY) {
ResourceLocation lootTableLocation = block.getLootTable().location();
if (lootTableLocation.equals(BuiltInLootTables.EMPTY.location())) {
return Collections.emptyList();
} else {
List<Item> items = new ArrayList<>();
try {
ServerLevel lv2 = ServerLevelStub.fastCreate();
getManager().getLootTable(lootTableLocation).getRandomItemsRaw(
new LootContext.Builder(
new LootParams.Builder(ServerLevelStub.fastCreate())
.withParameter(LootContextParams.ORIGIN, Vec3.atLowerCornerOf(BlockPos.ZERO))
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY)
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, null)
.withParameter(LootContextParams.BLOCK_STATE, block.defaultBlockState())
.create(LootContextParamSets.BLOCK)
).withOptionalRandomSeed(1L)
.create(null),
stack -> items.add(stack.getItem())
);
LootParams.Builder lv5 = new LootParams.Builder(lv2)
.withParameter(LootContextParams.ORIGIN, Vec3.ZERO)
.withParameter(LootContextParams.BLOCK_STATE, b.defaultBlockState())
.withParameter(LootContextParams.TOOL, new ItemStack(Items.NETHERITE_PICKAXE, 1));
getDrops(block, lv5).stream().map(ItemStack::getItem).forEach(items::add);
} catch (Exception e) {
e.printStackTrace();
}
@@ -263,9 +253,22 @@ public final class BlockOptionalMeta {
});
}
private static class ServerLevelStub extends ServerLevel {
private static List<ItemStack> getDrops(Block state, LootParams.Builder params) {
ResourceKey<LootTable> lv = state.getLootTable();
if (lv == BuiltInLootTables.EMPTY) {
return Collections.emptyList();
} else {
LootParams lv2 = params.withParameter(LootContextParams.BLOCK_STATE, state.defaultBlockState()).create(LootContextParamSets.BLOCK);
ServerLevelStub lv3 = (ServerLevelStub) lv2.getLevel();
LootTable lv4 = lv3.holder().getLootTable(lv);
return((ILootTable) lv4).invokeGetRandomItems(new LootContext.Builder(lv2).withOptionalRandomSeed(1).create(null));
}
}
public static class ServerLevelStub extends ServerLevel {
private static Minecraft client = Minecraft.getInstance();
private static Unsafe unsafe = getUnsafe();
private static CompletableFuture<RegistryAccess> registryAccess = load();
public ServerLevelStub(MinecraftServer $$0, Executor $$1, LevelStorageSource.LevelStorageAccess $$2, ServerLevelData $$3, ResourceKey<Level> $$4, LevelStem $$5, ChunkProgressListener $$6, boolean $$7, long $$8, List<CustomSpawner> $$9, boolean $$10, @Nullable RandomSequences $$11) {
super($$0, $$1, $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9, $$10, $$11);
@@ -285,6 +288,15 @@ public final class BlockOptionalMeta {
}
}
@Override
public RegistryAccess registryAccess() {
return registryAccess.join();
}
public ReloadableServerRegistries.Holder holder() {
return new ReloadableServerRegistries.Holder(registryAccess().freeze());
}
public static Unsafe getUnsafe() {
try {
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
@@ -295,5 +307,45 @@ public final class BlockOptionalMeta {
}
}
public static CompletableFuture<RegistryAccess> load() {
PackRepository packRepository = Minecraft.getInstance().getResourcePackRepository();
CloseableResourceManager closeableResourceManager = new MultiPackResourceManager(
PackType.SERVER_DATA,
List.of(packRepository.getPack(BuiltInPackSource.VANILLA_ID).open())
);
LayeredRegistryAccess<RegistryLayer> layeredRegistryAccess = loadAndReplaceLayer(
closeableResourceManager, RegistryLayer.createRegistryAccess(), RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES
);
return ReloadableServerResources.loadResources(
closeableResourceManager,
layeredRegistryAccess,
FeatureFlags.VANILLA_SET,
Commands.CommandSelection.INTEGRATED,
2,
Runnable::run,
Minecraft.getInstance()
).thenApply(reloadableServerResources -> reloadableServerResources.fullRegistries().get());
}
private static LayeredRegistryAccess<RegistryLayer> loadAndReplaceLayer(
ResourceManager resourceManager,
LayeredRegistryAccess<RegistryLayer> registryAccess,
RegistryLayer registryLayer,
List<RegistryDataLoader.RegistryData<?>> registryData
) {
RegistryAccess.Frozen frozen = loadLayer(resourceManager, registryAccess, registryLayer, registryData);
return registryAccess.replaceFrom(registryLayer, frozen);
}
private static RegistryAccess.Frozen loadLayer(
ResourceManager resourceManager,
LayeredRegistryAccess<RegistryLayer> registryAccess,
RegistryLayer registryLayer,
List<RegistryDataLoader.RegistryData<?>> registryData
) {
RegistryAccess.Frozen frozen = registryAccess.getAccessForLoading(registryLayer);
return RegistryDataLoader.load(resourceManager, frozen, registryData);
}
}
}

View File

@@ -0,0 +1,28 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.api.utils.accessor;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.storage.loot.LootContext;
public interface ILootTable {
ObjectArrayList<ItemStack> invokeGetRandomItems(LootContext context);
}

View File

@@ -27,17 +27,37 @@ import net.minecraft.client.KeyMapping;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.world.entity.player.Abilities;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Group;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
/**
* @author Brady
* @since 8/1/2018
*/
@Mixin(LocalPlayer.class)
public class MixinClientPlayerEntity {
@Unique
private static final MethodHandle MAY_FLY = baritone$resolveMayFly();
@Unique
private static MethodHandle baritone$resolveMayFly() {
try {
var lookup = MethodHandles.publicLookup();
return lookup.findVirtual(LocalPlayer.class, "mayFly", MethodType.methodType(boolean.class));
} catch (NoSuchMethodException e) {
return null;
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
@Inject(
method = "tick",
@@ -61,6 +81,7 @@ public class MixinClientPlayerEntity {
target = "net/minecraft/world/entity/player/Abilities.mayfly:Z"
)
)
@Group(name = "mayFly", min = 1, max = 1)
private boolean isAllowFlying(Abilities capabilities) {
IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer((LocalPlayer) (Object) this);
if (baritone == null) {
@@ -69,6 +90,22 @@ public class MixinClientPlayerEntity {
return !baritone.getPathingBehavior().isPathing() && capabilities.mayfly;
}
@Redirect(
method = "aiStep",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/player/LocalPlayer;mayFly()Z"
)
)
@Group(name = "mayFly", min = 1, max = 1)
private boolean onMayFlyNeoforge(LocalPlayer instance) throws Throwable {
IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer((LocalPlayer) (Object) this);
if (baritone == null) {
return (boolean) MAY_FLY.invokeExact(instance);
}
return !baritone.getPathingBehavior().isPathing() && (boolean) MAY_FLY.invokeExact(instance);
}
@Redirect(
method = "aiStep",
at = @At(

View File

@@ -19,41 +19,28 @@ package baritone.launch.mixins;
import baritone.api.utils.BlockOptionalMeta;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.ReloadableServerRegistries;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootDataManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(LootContext.Builder.class)
public class MixinLootContext {
public abstract class MixinLootContextBuilder {
@Redirect(
method = "create",
at = @At(
value = "INVOKE",
target = "net/minecraft/server/level/ServerLevel.getServer()Lnet/minecraft/server/MinecraftServer;"
)
)
private MinecraftServer getServer(ServerLevel world) {
if (world == null) {
return null;
@Shadow public abstract ServerLevel getLevel();
@Redirect(method = "create", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;reloadableRegistries()Lnet/minecraft/server/ReloadableServerRegistries$Holder;"))
private ReloadableServerRegistries.Holder create(MinecraftServer instance) {
if (instance != null) {
return instance.reloadableRegistries();
}
return world.getServer();
if (getLevel() instanceof BlockOptionalMeta.ServerLevelStub sls) {
return sls.holder();
}
return null;
}
@Redirect(
method = "create",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/MinecraftServer;getLootData()Lnet/minecraft/world/level/storage/loot/LootDataManager;"
)
)
private LootDataManager getLootTableManager(MinecraftServer server) {
if (server == null) {
return BlockOptionalMeta.getManager();
}
return server.getLootData();
}
}

View File

@@ -0,0 +1,34 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.launch.mixins;
import baritone.api.utils.accessor.ILootTable;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootTable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(LootTable.class)
public abstract class MixinLootTable implements ILootTable {
@Invoker
public abstract ObjectArrayList<ItemStack> invokeGetRandomItems(LootContext context);
}

View File

@@ -24,6 +24,7 @@ import baritone.api.event.events.TickEvent;
import baritone.api.event.events.WorldEvent;
import baritone.api.event.events.type.EventState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.ReceivingLevelScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.player.LocalPlayer;
@@ -130,7 +131,7 @@ public class MixinMinecraft {
method = "setLevel",
at = @At("HEAD")
)
private void preLoadWorld(ClientLevel world, CallbackInfo ci) {
private void preLoadWorld(ClientLevel world, ReceivingLevelScreen.Reason arg2, CallbackInfo ci) {
// If we're unloading the world but one doesn't exist, ignore it
if (this.level == null && world == null) {
return;
@@ -150,7 +151,7 @@ public class MixinMinecraft {
method = "setLevel",
at = @At("RETURN")
)
private void postLoadWorld(ClientLevel world, CallbackInfo ci) {
private void postLoadWorld(ClientLevel world, ReceivingLevelScreen.Reason arg2, CallbackInfo ci) {
// still fire event for both null, as that means we've just finished exiting a world
// mc.world changing is only the primary baritone
@@ -171,9 +172,8 @@ public class MixinMinecraft {
),
slice = @Slice(
from = @At(
value = "FIELD",
opcode = Opcodes.GETFIELD,
target = "Lnet/minecraft/client/Options;renderDebug:Z"
value = "INVOKE",
target = "Lnet/minecraft/client/gui/components/DebugScreenOverlay;showDebugScreen()Z"
),
to = @At(
value = "CONSTANT",

View File

@@ -44,9 +44,11 @@ public class MixinWorldRenderer {
at = @At("RETURN"),
locals = LocalCapture.CAPTURE_FAILSOFT
)
private void onStartHand(PoseStack matrixStackIn, float partialTicks, long finishTimeNano, boolean drawBlockOutline, Camera activeRenderInfoIn, GameRenderer gameRendererIn, LightTexture lightmapIn, Matrix4f projectionIn, CallbackInfo ci) {
private void onStartHand(float f, long l, boolean bl, Camera arg, GameRenderer arg2, LightTexture arg3, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
ibaritone.getGameEventHandler().onRenderPass(new RenderEvent(partialTicks, matrixStackIn, projectionIn));
PoseStack poseStack = new PoseStack();
poseStack.mulPose(matrix4f);
ibaritone.getGameEventHandler().onRenderPass(new RenderEvent(f, poseStack, matrix4f2));
}
}
}

View File

@@ -18,7 +18,8 @@
"MixinFireworkRocketEntity",
"MixinItemStack",
"MixinLivingEntity",
"MixinLootContext",
"MixinLootContextBuilder",
"MixinLootTable",
"MixinMinecraft",
"MixinNetworkManager",
"MixinPalettedContainer",
@@ -26,5 +27,7 @@
"MixinPlayerController",
"MixinScreen",
"MixinWorldRenderer"
],
"mixins": [
]
}

View File

@@ -76,7 +76,7 @@ public class SelCommand extends Command {
float lineWidth = Baritone.settings().selectionLineWidth.value;
boolean ignoreDepth = Baritone.settings().renderSelectionIgnoreDepth.value;
IRenderer.startLines(color, opacity, lineWidth, ignoreDepth);
IRenderer.emitAABB(event.getModelViewStack(), new AABB(pos1, pos1.offset(1, 1, 1)));
IRenderer.emitAABB(event.getModelViewStack(), new AABB(pos1));
IRenderer.endLines(ignoreDepth);
}
});

View File

@@ -177,15 +177,10 @@ public interface MovementHelper extends ActionCosts, Helper {
if (block instanceof CauldronBlock) {
return NO;
}
try { // A dodgy catch-all at the end, for most blocks with default behaviour this will work, however where blocks are special this will error out, and we can handle it when we have this information
if (state.isPathfindable(null, null, PathComputationType.LAND)) {
return YES;
} else {
return NO;
}
} catch (Throwable exception) {
System.out.println("The block " + state.getBlock().getName().getString() + " requires a special case due to the exception " + exception.getMessage());
return MAYBE;
if (state.isPathfindable(PathComputationType.LAND)) {
return YES;
} else {
return NO;
}
}
@@ -228,10 +223,7 @@ public interface MovementHelper extends ActionCosts, Helper {
return fluidState.getType() instanceof WaterFluid;
}
// every block that overrides isPassable with anything more complicated than a "return true;" or "return false;"
// has already been accounted for above
// therefore it's safe to not construct a blockpos from our x, y, z ints and instead just pass null
return state.isPathfindable(bsi.access, BlockPos.ZERO, PathComputationType.LAND); // workaround for future compatibility =P
return state.isPathfindable(PathComputationType.LAND);
}
static Ternary fullyPassableBlockState(BlockState state) {
@@ -259,16 +251,10 @@ public interface MovementHelper extends ActionCosts, Helper {
}
// door, fence gate, liquid, trapdoor have been accounted for, nothing else uses the world or pos parameters
// at least in 1.12.2 vanilla, that is.....
try { // A dodgy catch-all at the end, for most blocks with default behaviour this will work, however where blocks are special this will error out, and we can handle it when we have this information
if (state.isPathfindable(null, null, PathComputationType.LAND)) {
return YES;
} else {
return NO;
}
} catch (Throwable exception) {
// see PR #1087 for why
System.out.println("The block " + state.getBlock().getName().getString() + " requires a special case due to the exception " + exception.getMessage());
return MAYBE;
if (state.isPathfindable(PathComputationType.LAND)) {
return YES;
} else {
return NO;
}
}
@@ -293,11 +279,14 @@ public interface MovementHelper extends ActionCosts, Helper {
if (fullyPassable == NO) {
return false;
}
return fullyPassablePosition(new BlockStateInterface(ctx), pos.getX(), pos.getY(), pos.getZ(), state); // meh
return state.isPathfindable(PathComputationType.LAND);
}
/**
* params retained for backwards compatibility
*/
static boolean fullyPassablePosition(BlockStateInterface bsi, int x, int y, int z, BlockState state) {
return state.isPathfindable(bsi.access, bsi.isPassableBlockPos.set(x, y, z), PathComputationType.LAND);
return state.isPathfindable(PathComputationType.LAND);
}
static boolean isReplaceable(int x, int y, int z, BlockState state, BlockStateInterface bsi) {

View File

@@ -46,7 +46,6 @@ import baritone.utils.schematic.SelectionSchematic;
import baritone.utils.schematic.SchematicSystem;
import baritone.utils.schematic.litematica.LitematicaHelper;
import baritone.utils.schematic.schematica.SchematicaHelper;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import net.minecraft.core.BlockPos;
@@ -1050,8 +1049,8 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
if (!ignoreDirection && ignoredProps.isEmpty()) {
return first.equals(second); // early return if no properties are being ignored
}
ImmutableMap<Property<?>, Comparable<?>> map1 = first.getValues();
ImmutableMap<Property<?>, Comparable<?>> map2 = second.getValues();
Map<Property<?>, Comparable<?>> map1 = first.getValues();
Map<Property<?>, Comparable<?>> map2 = second.getValues();
for (Property<?> prop : map1.keySet()) {
if (map1.get(prop) != map2.get(prop)
&& !(ignoreDirection && ORIENTATION_PROPS.contains(prop))

View File

@@ -360,7 +360,7 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
private boolean shouldLandForSafety() {
ItemStack chest = ctx.player().getItemBySlot(EquipmentSlot.CHEST);
if (chest.getItem() != Items.ELYTRA || chest.getItem().getMaxDamage() - chest.getDamageValue() < Baritone.settings().elytraMinimumDurability.value) {
if (chest.getItem() != Items.ELYTRA || chest.getMaxDamage() - chest.getDamageValue() < Baritone.settings().elytraMinimumDurability.value) {
// elytrabehavior replaces when durability <= minimumDurability, so if durability < minimumDurability then we can reasonably assume that the elytra will soon be broken without replacement
return true;
}

View File

@@ -35,6 +35,7 @@ import it.unimi.dsi.fastutil.floats.FloatArrayList;
import it.unimi.dsi.fastutil.floats.FloatIterator;
import net.minecraft.core.BlockPos;
import net.minecraft.core.NonNullList;
import net.minecraft.core.component.DataComponents;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
import net.minecraft.util.Mth;
@@ -44,6 +45,7 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;
import net.minecraft.world.inventory.ClickType;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.component.Fireworks;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.block.AirBlock;
@@ -922,9 +924,8 @@ public final class ElytraBehavior implements Helper {
if (itemStack.getItem() != Items.FIREWORK_ROCKET) {
return false;
}
// If it has NBT data, make sure it won't cause us to explode.
final CompoundTag compound = itemStack.getTagElement("Fireworks");
return compound == null || !compound.getAllKeys().contains("Explosions");
Fireworks fw = itemStack.get(DataComponents.FIREWORKS);
return fw != null && fw.explosions().isEmpty();
}
private static boolean isBoostingFireworks(final ItemStack itemStack) {
@@ -932,11 +933,9 @@ public final class ElytraBehavior implements Helper {
}
private static OptionalInt getFireworkBoost(final ItemStack itemStack) {
if (isFireworks(itemStack)) {
final CompoundTag compound = itemStack.getTagElement("Fireworks");
if (compound != null && compound.getAllKeys().contains("Flight")) {
return OptionalInt.of(compound.getByte("Flight"));
}
Fireworks fw = itemStack.get(DataComponents.FIREWORKS);
if (fw != null && fw.explosions().isEmpty()) {
return OptionalInt.of(fw.flightDuration());
}
return OptionalInt.empty();
}
@@ -1292,7 +1291,7 @@ public final class ElytraBehavior implements Helper {
NonNullList<ItemStack> invy = ctx.player().getInventory().items;
for (int i = 0; i < invy.size(); i++) {
ItemStack slot = invy.get(i);
if (slot.getItem() == Items.ELYTRA && (slot.getItem().getMaxDamage() - slot.getDamageValue()) > Baritone.settings().elytraMinimumDurability.value) {
if (slot.getItem() == Items.ELYTRA && (slot.getMaxDamage() - slot.getDamageValue()) > Baritone.settings().elytraMinimumDurability.value) {
return i;
}
}
@@ -1306,7 +1305,7 @@ public final class ElytraBehavior implements Helper {
ItemStack chest = ctx.player().getItemBySlot(EquipmentSlot.CHEST);
if (chest.getItem() != Items.ELYTRA
|| chest.getItem().getMaxDamage() - chest.getDamageValue() > Baritone.settings().elytraMinimumDurability.value) {
|| chest.getMaxDamage() - chest.getDamageValue() > Baritone.settings().elytraMinimumDurability.value) {
return;
}

View File

@@ -37,7 +37,7 @@ public class Selection implements ISelection {
max.z - min.z + 1
);
this.aabb = new AABB(this.min, this.max.offset(1, 1, 1));
this.aabb = new AABB(min.x, min.y, min.z, max.x + 1, max.y + 1, max.z + 1);
}
@Override

View File

@@ -38,13 +38,13 @@ public class SelectionRenderer implements IRenderer, AbstractGameEventListener {
IRenderer.glColor(settings.colorSelectionPos1.value, opacity);
for (ISelection selection : selections) {
IRenderer.emitAABB(stack, new AABB(selection.pos1(), selection.pos1().offset(1, 1, 1)));
IRenderer.emitAABB(stack, new AABB(selection.pos1()));
}
IRenderer.glColor(settings.colorSelectionPos2.value, opacity);
for (ISelection selection : selections) {
IRenderer.emitAABB(stack, new AABB(selection.pos2(), selection.pos2().offset(1, 1, 1)));
IRenderer.emitAABB(stack, new AABB(selection.pos2()));
}
}

View File

@@ -30,9 +30,9 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.chunk.status.ChunkStatus;
/**
* Wraps get for chuck caching capability

View File

@@ -115,11 +115,10 @@ public interface IRenderer {
float x1, float y1, float z1,
float x2, float y2, float z2,
float nx, float ny, float nz) {
final Matrix4f matrix4f = stack.last().pose();
final Matrix3f normal = stack.last().normal();
PoseStack.Pose pose = stack.last();
buffer.vertex(matrix4f, x1, y1, z1).color(color[0], color[1], color[2], color[3]).normal(normal, nx, ny, nz).endVertex();
buffer.vertex(matrix4f, x2, y2, z2).color(color[0], color[1], color[2], color[3]).normal(normal, nx, ny, nz).endVertex();
buffer.vertex(pose, x1, y1, z1).color(color[0], color[1], color[2], color[3]).normal(pose, nx, ny, nz).endVertex();
buffer.vertex(pose, x2, y2, z2).color(color[0], color[1], color[2], color[3]).normal(pose, nx, ny, nz).endVertex();
}
static void emitAABB(PoseStack stack, AABB aabb) {

View File

@@ -86,7 +86,7 @@ public class ToolSet {
private int getMaterialCost(ItemStack itemStack) {
if (itemStack.getItem() instanceof TieredItem) {
TieredItem tool = (TieredItem) itemStack.getItem();
return tool.getTier().getLevel();
return (int) tool.getTier().getAttackDamageBonus();
} else {
return -1;
}
@@ -190,7 +190,7 @@ public class ToolSet {
float speed = item.getDestroySpeed(state);
if (speed > 1) {
int effLevel = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_EFFICIENCY, item);
int effLevel = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.EFFICIENCY, item);
if (effLevel > 0 && !item.isEmpty()) {
speed += effLevel * effLevel + 1;
}

View File

@@ -23,6 +23,7 @@ import baritone.utils.schematic.format.defaults.LitematicaSchematic;
import baritone.utils.schematic.format.defaults.MCEditSchematic;
import baritone.utils.schematic.format.defaults.SpongeSchematic;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtAccounter;
import net.minecraft.nbt.NbtIo;
import org.apache.commons.io.FilenameUtils;
@@ -46,7 +47,7 @@ public enum DefaultSchematicFormats implements ISchematicFormat {
MCEDIT("schematic") {
@Override
public IStaticSchematic parse(InputStream input) throws IOException {
return new MCEditSchematic(NbtIo.readCompressed(input));
return new MCEditSchematic(NbtIo.readCompressed(input, NbtAccounter.unlimitedHeap()));
}
},
@@ -58,7 +59,7 @@ public enum DefaultSchematicFormats implements ISchematicFormat {
SPONGE("schem") {
@Override
public IStaticSchematic parse(InputStream input) throws IOException {
CompoundTag nbt = NbtIo.readCompressed(input);
CompoundTag nbt = NbtIo.readCompressed(input, NbtAccounter.unlimitedHeap());
int version = nbt.getInt("Version");
switch (version) {
case 1:
@@ -76,7 +77,7 @@ public enum DefaultSchematicFormats implements ISchematicFormat {
LITEMATICA("litematic") {
@Override
public IStaticSchematic parse(InputStream input) throws IOException {
CompoundTag nbt = NbtIo.readCompressed(input);
CompoundTag nbt = NbtIo.readCompressed(input, NbtAccounter.unlimitedHeap());
int version = nbt.getInt("Version");
switch (version) {
case 4: //1.12

View File

@@ -95,7 +95,7 @@ jar {
}
task proguard(type: ProguardTask) {
proguardVersion "7.2.1"
proguardVersion "7.4.2"
}
task createDist(type: CreateDistTask, dependsOn: proguard)