PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/common/buildcraft/lib/misc/RegistryUtil.java

https://github.com/2xsaiko/BuildCraft
Java | 22 lines | 12 code | 5 blank | 5 comment | 0 complexity | 18b3f6b82167febe513cb91a47d757de MD5 | raw file
 1/*
 2 * Copyright (c) 2017 SpaceToad and the BuildCraft team
 3 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 4 * distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/
 5 */
 6
 7package buildcraft.lib.misc;
 8
 9import net.minecraft.block.Block;
10import net.minecraft.item.Item;
11
12import net.minecraftforge.fml.common.registry.ForgeRegistries;
13
14public class RegistryUtil {
15    public static boolean isRegistered(Block block) {
16        return ForgeRegistries.BLOCKS.containsValue(block);
17    }
18
19    public static boolean isRegistered(Item item) {
20        return ForgeRegistries.ITEMS.containsValue(item);
21    }
22}