Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mist475 committed Sep 2, 2024
1 parent 3871a10 commit 803c2b8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/main/java/com/gtnewhorizons/angelica/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ public void worldLoad(WorldEvent.Load event) {

if (AngelicaConfig.enableSodium) {
// Register all blocks. Because blockids are unique to a world, this must be done each load
GameData.getBlockRegistry().forEach(o -> {

final Block b = (Block) o;
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, true, true);
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, false, true);
GameData.getBlockRegistry().typeSafeIterable().forEach(o -> {
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(o, true, true);
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(o, false, true);
});
}
}
Expand Down Expand Up @@ -184,7 +182,7 @@ public void onTick(TickEvent.ServerTickEvent event) {
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRenderOverlay(RenderGameOverlayEvent.Text event) {
Minecraft mc = Minecraft.getMinecraft();
if (event.isCanceled() || !mc.gameSettings.showDebugInfo || event.left.size() < 1) return;
if (event.isCanceled() || !mc.gameSettings.showDebugInfo || event.left.isEmpty()) return;
NetHandlerPlayClient cl = mc.getNetHandler();
if (cl != null) {
IntegratedServer srv = mc.getIntegratedServer();
Expand All @@ -195,7 +193,7 @@ public void onRenderOverlay(RenderGameOverlayEvent.Text event) {
}
}
if (AngelicaConfig.showBlockDebugInfo && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
if (!event.right.isEmpty() && Objects.firstNonNull(event.right.get(event.right.size() - 1), "").length() > 0) event.right.add("");
if (!event.right.isEmpty() && !Objects.firstNonNull(event.right.get(event.right.size() - 1), "").isEmpty()) event.right.add("");
Block block = mc.theWorld.getBlock(mc.objectMouseOver.blockX, mc.objectMouseOver.blockY, mc.objectMouseOver.blockZ);
int meta = mc.theWorld.getBlockMetadata(mc.objectMouseOver.blockX, mc.objectMouseOver.blockY, mc.objectMouseOver.blockZ);
event.right.add(Block.blockRegistry.getNameForObject(block));
Expand Down Expand Up @@ -279,7 +277,7 @@ public void onRenderOverlay(RenderGameOverlayEvent.Text event) {
public void onGuiOpen(GuiOpenEvent event) {
if (!event.isCanceled() && event.gui instanceof GuiMainMenu && gameStartTime == -1) {
gameStartTime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f;
LOGGER.info("The game loaded in " + gameStartTime + " seconds.");
LOGGER.info("The game loaded in {} seconds.", gameStartTime);
}
}

Expand Down

0 comments on commit 803c2b8

Please sign in to comment.