/* * Copyright (c) 2021 TeamMoeg * * This file is part of Steam Powered. * * Steam Powered is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3. * * Steam Powered 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Steam Powered. If not, see . */ package com.teammoeg.steampowered.client; import com.simibubi.create.AllItems; import net.minecraft.client.Minecraft; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.level.Level; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class ClientUtils { public static Minecraft mc() { return Minecraft.getInstance(); } public static Level getClientWorld() { return mc().level; } public static boolean hasGoggles() { return AllItems.GOGGLES.isIn(mc().player.getItemBySlot(EquipmentSlot.HEAD)); } }