Search in sources :

Example 1 with BlockStateMatcher

use of gregtech.common.terminal.app.worldprospector.matcher.BlockStateMatcher in project GregTech by GregTechCEu.

the class WorldProspectorARApp method onAROpened.

@SideOnly(Side.CLIENT)
@Override
public void onAROpened() {
    founds = new HashMap<>();
    radius = 0;
    maxRadius = getMaxRadius();
    lastPos = null;
    matchers = new HashSet<>();
    for (Tuple<ItemStack, Integer> stack : getAllSlotStack()) {
        if (stack.getFirst().getItem() instanceof ItemBlock) {
            Block block = ((ItemBlock) stack.getFirst().getItem()).getBlock();
            if (block != Blocks.AIR) {
                matchers.add(new BlockStateMatcher(block.getStateFromMeta(stack.getFirst().getMetadata()), stack.getSecond()));
            }
        }
    }
    matchers.forEach(matcher -> founds.put(matcher, new HashMap<>()));
}
Also used : BlockStateMatcher(gregtech.common.terminal.app.worldprospector.matcher.BlockStateMatcher) Block(net.minecraft.block.Block) ItemBlock(net.minecraft.item.ItemBlock) ItemStack(net.minecraft.item.ItemStack) ItemBlock(net.minecraft.item.ItemBlock) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

BlockStateMatcher (gregtech.common.terminal.app.worldprospector.matcher.BlockStateMatcher)1 Block (net.minecraft.block.Block)1 ItemBlock (net.minecraft.item.ItemBlock)1 ItemStack (net.minecraft.item.ItemStack)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1