Added a nag message when a player joins the world that asks the player to enable the experimental Forge lighting pipeline to ensure correct rendering

This commit is contained in:
raoulvdberge
2020-10-18 16:37:01 +02:00
parent 68a8403795
commit cab5ff2d12
3 changed files with 26 additions and 0 deletions

View File

@@ -4,6 +4,8 @@
- Fixed server crash when scrolling in Grid (Darkere) - Fixed server crash when scrolling in Grid (Darkere)
- Fixed various issues with Grid interactions working without power (Darkere) - Fixed various issues with Grid interactions working without power (Darkere)
- Added a JEI synchronized (two-way) search box mode to the Grid (ScoreUnder) - Added a JEI synchronized (two-way) search box mode to the Grid (ScoreUnder)
- Added a nag message when a player joins the world that asks the player to enable the experimental Forge lighting
pipeline to ensure correct rendering (raoulvdberge)
### 1.9.7 ### 1.9.7
- Added functionality to move items in the Grid with shift/ctrl + scrolling (Darkere) - Added functionality to move items in the Grid with shift/ctrl + scrolling (Darkere)

View File

@@ -0,0 +1,22 @@
package com.refinedmods.refinedstorage.render;
import net.minecraft.util.text.*;
import net.minecraftforge.common.ForgeConfig;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
public class ExperimentalLightingPipelineNagger {
@SubscribeEvent
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent e) {
if (Boolean.FALSE.equals(ForgeConfig.CLIENT.experimentalForgeLightPipelineEnabled.get())) {
IFormattableTextComponent message = new StringTextComponent("[Refined Storage] ").setStyle(Styles.AQUA.setBold(true));
message.append(new StringTextComponent("Please set ").setStyle(Styles.WHITE.setBold(false)));
message.append(new StringTextComponent("experimentalForgeLightPipelineEnabled").setStyle(Styles.GRAY.setItalic(true)));
message.append(new StringTextComponent(" to ").setStyle(Styles.WHITE.setBold(false)));
message.append(new StringTextComponent("true").setStyle(Style.EMPTY.setColor(Color.func_240744_a_(TextFormatting.GREEN)).setBold(true).setItalic(true)));
message.append(new StringTextComponent(" in the Forge client config to ensure correct rendering of Refined Storage blocks.").setStyle(Styles.WHITE.setBold(false)));
e.getPlayer().sendStatusMessage(message, false);
}
}
}

View File

@@ -9,6 +9,7 @@ import com.refinedmods.refinedstorage.item.property.ControllerItemPropertyGetter
import com.refinedmods.refinedstorage.item.property.NetworkItemPropertyGetter; import com.refinedmods.refinedstorage.item.property.NetworkItemPropertyGetter;
import com.refinedmods.refinedstorage.item.property.SecurityCardItemPropertyGetter; import com.refinedmods.refinedstorage.item.property.SecurityCardItemPropertyGetter;
import com.refinedmods.refinedstorage.render.BakedModelOverrideRegistry; import com.refinedmods.refinedstorage.render.BakedModelOverrideRegistry;
import com.refinedmods.refinedstorage.render.ExperimentalLightingPipelineNagger;
import com.refinedmods.refinedstorage.render.color.PatternItemColor; import com.refinedmods.refinedstorage.render.color.PatternItemColor;
import com.refinedmods.refinedstorage.render.model.*; import com.refinedmods.refinedstorage.render.model.*;
import com.refinedmods.refinedstorage.render.resourcepack.ResourcePackListener; import com.refinedmods.refinedstorage.render.resourcepack.ResourcePackListener;
@@ -166,6 +167,7 @@ public class ClientSetup {
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onModelBake); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onModelBake);
MinecraftForge.EVENT_BUS.addListener(new ExperimentalLightingPipelineNagger()::onPlayerLoggedIn);
API.instance().addPatternRenderHandler(pattern -> Screen.hasShiftDown()); API.instance().addPatternRenderHandler(pattern -> Screen.hasShiftDown());