use of com.qouteall.immersive_portals.render.DimensionRenderHelper in project ImmersivePortalsMod by qouteall.
the class ClientWorldLoader method initializeIfNeeded.
private void initializeIfNeeded() {
if (!isInitialized) {
assert (mc.world != null);
assert (mc.worldRenderer != null);
DimensionType playerDimension = mc.world.getDimension().getType();
clientWorldMap.put(playerDimension, mc.world);
worldRendererMap.put(playerDimension, mc.worldRenderer);
renderHelperMap.put(mc.world.dimension.getType(), new DimensionRenderHelper(mc.world));
isHardCore = mc.world.getLevelProperties().isHardcore();
isInitialized = true;
}
}
use of com.qouteall.immersive_portals.render.DimensionRenderHelper in project ImmersivePortalsMod by qouteall.
the class ClientWorldLoader method getDimensionRenderHelper.
public DimensionRenderHelper getDimensionRenderHelper(DimensionType dimension) {
initializeIfNeeded();
DimensionRenderHelper result = renderHelperMap.computeIfAbsent(dimension, dimensionType -> {
return new DimensionRenderHelper(getOrCreateFakedWorld(dimension));
});
assert result.world.dimension.getType() == dimension;
return result;
}
use of com.qouteall.immersive_portals.render.DimensionRenderHelper 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;
}
Aggregations