Skip to content

Commit

Permalink
move log statement to client
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Feb 20, 2021
1 parent e1f027b commit fa2e74e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/main/java/dev/upcraft/isfine/ThisIsFine.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,14 @@ public static boolean shouldHideFireFor(@Nullable PlayerEntity player) {
return player != null && player.getEquippedStack(EquipmentSlot.HEAD).getItem() == FineItems.SHADES;
}

public static Logger getLogger() {
return logger;
}

@Override
public void onInitialize() {
//TODO switch to tag-based hiding of blocks
//ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(new FineReloadListener());
Stream.of(Blocks.FIRE, Blocks.SOUL_FIRE).forEach(block -> BlockFibRegistry.register(BlockFib.builder(block, Blocks.AIR).withCondition(ThisIsFine::shouldHideFireFor).build()));
"{}\n" +
"FROM: <Minecraft>\n" +
"SENT: {}\n" +
"TO: <YOU>\n" +
"SUBJECT: Fire!\n" +
"\n" +
"\n" +
"Dear Sir/Madam,\n" +
"\n" +
"Fire! Fire! Help me!\n" +
"123 Carenden Road\n" +
"\n" +
"Looking forward to hearing from you\n" +
"All the best, Maurice Moss\n" +
"\n" +
"{}", spacer, Instant.now(), spacer);
// @formatter:on
registerFib(Blocks.FIRE);
registerFib(Blocks.SOUL_FIRE);
}
}
}
23 changes: 23 additions & 0 deletions src/main/java/dev/upcraft/isfine/client/ClientIsFine.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,35 @@
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.ArmorRenderingRegistry;
import net.minecraft.client.MinecraftClient;

import java.time.Instant;

@Environment(EnvType.CLIENT)
@CalledByReflection
public class ClientIsFine implements ClientModInitializer {
@Override
public void onInitializeClient() {
// @formatter:off
String spacer = "--------------------------";
ThisIsFine.getLogger().info("\n" +
"{}\n" +
"FROM: <Minecraft>\n" +
"SENT: {}\n" +
"TO: <{}@{}>\n" +
"SUBJECT: Fire!\n" +
"\n" +
"\n" +
"Dear Sir/Madam,\n" +
"\n" +
"Fire! Fire! Help me!\n" +
"123 Carenden Road\n" +
"\n" +
"Looking forward to hearing from you\n" +
"All the best, Maurice Moss\n" +
"\n" +
"{}", spacer, MinecraftClient.getInstance().getSession().getUsername(), MinecraftClient.getInstance().getSession().getUuid(), Instant.now(), spacer);
// @formatter:on
ArmorRenderingRegistry.registerSimpleTexture(ThisIsFine.id("shades"), FineItems.SHADES);
}
}

0 comments on commit fa2e74e

Please sign in to comment.