working for realsies
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package baritone.api.utils;
|
package baritone.api.utils;
|
||||||
|
|
||||||
|
import net.minecraft.block.AirBlock;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
@@ -54,7 +55,9 @@ public class BlockUtils {
|
|||||||
return null; // cached as null
|
return null; // cached as null
|
||||||
}
|
}
|
||||||
block = Registry.BLOCK.getOrDefault(ResourceLocation.tryCreate(name.contains(":") ? name : "minecraft:" + name));
|
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
|
Map<String, Block> copy = new HashMap<>(resourceCache); // read only copy is safe, wont throw concurrentmodification
|
||||||
copy.put(name, block);
|
copy.put(name, block);
|
||||||
resourceCache = copy;
|
resourceCache = copy;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
|
|||||||
private int tickCount;
|
private int tickCount;
|
||||||
|
|
||||||
private static LootTableManager manager;
|
private static LootTableManager manager;
|
||||||
private static Map<Block, List<Item>> drops;
|
private static Map<Block, List<Item>> drops = new HashMap<>();
|
||||||
|
|
||||||
public MineProcess(Baritone baritone) {
|
public MineProcess(Baritone baritone) {
|
||||||
super(baritone);
|
super(baritone);
|
||||||
|
|||||||
Reference in New Issue
Block a user