working for realsies

This commit is contained in:
Leijurv 2019-07-23 15:47:18 -07:00
parent 9f951f261d
commit 36315c5151
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 5 additions and 2 deletions

View File

@ -17,6 +17,7 @@
package baritone.api.utils;
import net.minecraft.block.AirBlock;
import net.minecraft.block.Block;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
@ -54,7 +55,9 @@ public class BlockUtils {
return null; // cached as null
}
block = Registry.BLOCK.getOrDefault(ResourceLocation.tryCreate(name.contains(":") ? name : "minecraft:" + name));
// TODO this again returns air instead of null!
if (block instanceof AirBlock && !name.equals("air")) {
block = null;
}
Map<String, Block> copy = new HashMap<>(resourceCache); // read only copy is safe, wont throw concurrentmodification
copy.put(name, block);
resourceCache = copy;

View File

@ -70,7 +70,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
private int tickCount;
private static LootTableManager manager;
private static Map<Block, List<Item>> drops;
private static Map<Block, List<Item>> drops = new HashMap<>();
public MineProcess(Baritone baritone) {
super(baritone);