All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.hendrixshen.magiclib.util.minecraft.ResourceLocationUtil Maven / Gradle / Ivy

There is a newer version: 0.6.59
Show newest version
/*
 * This file is part of the Carpet TIS Addition project, licensed under the
 * GNU Lesser General Public License v3.0
 *
 * Copyright (C) 2023  Fallen_Breath and contributors
 *
 * Carpet TIS Addition is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Carpet TIS Addition 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Carpet TIS Addition.  If not, see .
 */

package top.hendrixshen.magiclib.util.minecraft;

import net.minecraft.class_1299;
import net.minecraft.class_2248;
import net.minecraft.class_2591;
import net.minecraft.class_2960;
import net.minecraft.class_3611;
import net.minecraft.class_4158;
import net.minecraft.class_7923;
import org.jetbrains.annotations.NotNull;

/**
 * Reference to Carpet-TIS-Addition
 */
public class ResourceLocationUtil {
    public static @NotNull class_2960 id(class_2248 block) {
        //#if MC > 11902
        return class_7923.field_41175.method_10221(block);
        //#else
        //$$ return Registry.BLOCK.getKey(block);
        //#endif
    }

    public static @NotNull class_2960 id(class_3611 fluid) {
        //#if MC > 11902
        return class_7923.field_41173.method_10221(fluid);
        //#else
        //$$ return Registry.FLUID.getKey(fluid);
        //#endif
    }

    public static @NotNull class_2960 id(class_1299 entityType) {
        //#if MC > 11902
        return class_7923.field_41177.method_10221(entityType);
        //#else
        //$$ return Registry.ENTITY_TYPE.getKey(entityType);
        //#endif
    }

    public static class_2960 id(class_2591 blockEntityType) {
        //#if MC > 11902
        return class_7923.field_41181.method_10221(blockEntityType);
        //#else
        //$$ return Registry.BLOCK_ENTITY_TYPE.getKey(blockEntityType);
        //#endif
    }

    public static class_2960 id(class_4158 poiType) {
        //#if MC > 11902
        return class_7923.field_41128.method_10221(poiType);
        //#else
        //$$ return Registry.POINT_OF_INTEREST_TYPE.getKey(poiType);
        //#endif
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy