Search in sources :

Example 1 with BackgroundRenderer

use of net.minecraft.client.render.BackgroundRenderer in project ImmersivePortalsMod by qouteall.

the class MyCommandClient method reportFogColor.

private static int reportFogColor(CommandContext<ServerCommandSource> context) {
    MinecraftClient.getInstance().execute(() -> {
        StringBuilder str = new StringBuilder();
        CGlobal.clientWorldLoader.clientWorldMap.values().forEach(world -> {
            DimensionRenderHelper helper = CGlobal.clientWorldLoader.getDimensionRenderHelper(world.dimension.getType());
            str.append(String.format("%s %s %s %s\n", world.dimension.getType(), helper.fogRenderer, helper.getFogColor(), ((IEBackgroundRenderer) helper.fogRenderer).getDimensionConstraint()));
        });
        BackgroundRenderer currentFogRenderer = ((IEGameRenderer) MinecraftClient.getInstance().gameRenderer).getBackgroundRenderer();
        str.append(String.format("current: %s %s \n switched %s \n", currentFogRenderer, ((IEBackgroundRenderer) currentFogRenderer).getDimensionConstraint(), CGlobal.switchedFogRenderer));
        String result = str.toString();
        Helper.log(str);
        McHelper.getServer().execute(() -> {
            try {
                context.getSource().getPlayer().sendMessage(new LiteralText(result));
            } catch (CommandSyntaxException e) {
                e.printStackTrace();
            }
        });
    });
    return 0;
}
Also used : DimensionRenderHelper(com.qouteall.immersive_portals.render.DimensionRenderHelper) CommandSyntaxException(com.mojang.brigadier.exceptions.CommandSyntaxException) BackgroundRenderer(net.minecraft.client.render.BackgroundRenderer) LiteralText(net.minecraft.text.LiteralText)

Aggregations

CommandSyntaxException (com.mojang.brigadier.exceptions.CommandSyntaxException)1 DimensionRenderHelper (com.qouteall.immersive_portals.render.DimensionRenderHelper)1 BackgroundRenderer (net.minecraft.client.render.BackgroundRenderer)1 LiteralText (net.minecraft.text.LiteralText)1