Search in sources :

Example 1 with ModIdentifier

use of net.mrscauthd.beyond_earth.util.ModIdentifier in project beyond-earth-fabricated by SomeoneIs404.

the class BeyondEarthClient method onInitializeClient.

@Override
@Environment(EnvType.CLIENT)
public void onInitializeClient() {
    BlockEntityRendererRegistry.register(ModBlocks.FLAG_BLOCK_ENTITY, ctx -> new FlagBlockEntityRenderer());
    // Fluids.
    FluidRenderHandlerRegistry.INSTANCE.register(ModFluids.FUEL_STILL, ModFluids.FLOWING_FUEL, new SimpleFluidRenderHandler(new ModIdentifier("blocks/fluid_fuel_still"), new ModIdentifier("blocks/fluid_fuel_flow"), new ModIdentifier("blocks/fuel_overlay")));
    FluidRenderHandlerRegistry.INSTANCE.register(ModFluids.OIL_STILL, ModFluids.FLOWING_OIL, new SimpleFluidRenderHandler(new ModIdentifier("blocks/fluid_oil_still"), new ModIdentifier("blocks/fluid_oil_flow"), new ModIdentifier("blocks/oil_overlay")));
    // Fluid textures.
    ClientSpriteRegistryCallback.event(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE).register((atlasTexture, registry) -> {
        registry.register(new ModIdentifier("blocks/fluid_fuel_still"));
        registry.register(new ModIdentifier("blocks/fluid_fuel_flow"));
        registry.register(new ModIdentifier("blocks/fuel_overlay"));
        registry.register(new ModIdentifier("blocks/fluid_oil_still"));
        registry.register(new ModIdentifier("blocks/fluid_oil_flow"));
        registry.register(new ModIdentifier("blocks/oil_overlay"));
    });
    BlockRenderLayerMap.INSTANCE.putFluids(RenderLayer.getTranslucent(), ModFluids.FUEL_STILL, ModFluids.FLOWING_FUEL);
}
Also used : FlagBlockEntityRenderer(net.mrscauthd.beyond_earth.client.renderer.FlagBlockEntityRenderer) SimpleFluidRenderHandler(net.fabricmc.fabric.api.client.render.fluid.v1.SimpleFluidRenderHandler) ModIdentifier(net.mrscauthd.beyond_earth.util.ModIdentifier) Environment(net.fabricmc.api.Environment)

Example 2 with ModIdentifier

use of net.mrscauthd.beyond_earth.util.ModIdentifier in project beyond-earth-fabricated by SomeoneIs404.

the class ModFluids method register.

public static void register() {
    // Fuel Fluid.
    FUEL_STILL = Registry.register(Registry.FLUID, new ModIdentifier("fuel"), new FuelFluid.Still());
    FLOWING_FUEL = Registry.register(Registry.FLUID, new ModIdentifier("flowing_fuel"), new FuelFluid.Flowing());
    FUEL_BLOCK = new FluidBlock(FUEL_STILL, FabricBlockSettings.copy(Blocks.WATER).strength(100.0f).dropsNothing());
    ModBlocks.register("fuel", FUEL_BLOCK);
    FUEL_BUCKET = new BucketItem(FUEL_STILL, new Item.Settings().recipeRemainder(Items.BUCKET).maxCount(1).group(ModItems.ITEM_GROUP_NORMAL));
    ModItems.register("fuel_bucket", FUEL_BUCKET);
    // Oil Fluid.
    OIL_STILL = Registry.register(Registry.FLUID, new ModIdentifier("oil"), new OilFluid.Still());
    FLOWING_OIL = Registry.register(Registry.FLUID, new ModIdentifier("flowing_oil"), new OilFluid.Flowing());
    OIL_BLOCK = new FluidBlock(OIL_STILL, FabricBlockSettings.copy(Blocks.WATER).strength(100.0f).dropsNothing());
    ModBlocks.register("oil", OIL_BLOCK);
    OIL_BUCKET = new BucketItem(OIL_STILL, new Item.Settings().recipeRemainder(Items.BUCKET).maxCount(1).group(ModItems.ITEM_GROUP_NORMAL));
    ModItems.register("oil_bucket", OIL_BUCKET);
}
Also used : BucketItem(net.minecraft.item.BucketItem) Item(net.minecraft.item.Item) FluidBlock(net.minecraft.block.FluidBlock) BucketItem(net.minecraft.item.BucketItem) ModIdentifier(net.mrscauthd.beyond_earth.util.ModIdentifier)

Aggregations

ModIdentifier (net.mrscauthd.beyond_earth.util.ModIdentifier)2 Environment (net.fabricmc.api.Environment)1 SimpleFluidRenderHandler (net.fabricmc.fabric.api.client.render.fluid.v1.SimpleFluidRenderHandler)1 FluidBlock (net.minecraft.block.FluidBlock)1 BucketItem (net.minecraft.item.BucketItem)1 Item (net.minecraft.item.Item)1 FlagBlockEntityRenderer (net.mrscauthd.beyond_earth.client.renderer.FlagBlockEntityRenderer)1