Skip to content

Commit

Permalink
Merge branch '1.21.4' into 1.21.5
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Jan 17, 2025
2 parents a60dad6 + 0da6e10 commit 88ecf92
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 226 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Make sure to clear this after each release
Put changelog here:

-----------------
- Restored the directional Gravity API
- Exposed the `structure_upgrade` command to players outside development environments.
- Removed the Camera item in favor of the `panorama` command.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
min_loader_version=0.16.10

# Mod Properties
mod_version = 1.9.11
mod_version = 1.9.12
maven_group = net.frozenblock
archives_base_name = FrozenLib

Expand Down
8 changes: 6 additions & 2 deletions src/main/java/net/frozenblock/lib/FrozenClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
package net.frozenblock.lib;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientChunkEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.frozenblock.lib.cape.client.impl.ClientCapeData;
import net.frozenblock.lib.config.frozenlib_config.FrozenLibConfig;
import net.frozenblock.lib.core.client.api.PanoramaCommand;
import net.frozenblock.lib.debug.client.impl.DebugRenderManager;
import net.frozenblock.lib.debug.networking.StructureDebugRequestPayload;
import net.frozenblock.lib.entrypoint.api.FrozenClientEntrypoint;
Expand All @@ -49,8 +51,6 @@ public final class FrozenClient implements ClientModInitializer {

@Override
public void onInitializeClient() {
FrozenMain.init();

FrozenClientRegistry.initRegistry();
ModIntegrations.initializePreFreeze(); // Mod integrations must run after normal mod initialization

Expand All @@ -70,6 +70,10 @@ public void onInitializeClient() {
Panoramas.addPanorama(ResourceLocation.withDefaultNamespace("textures/gui/title/background/panorama"));
ClientCapeData.init();

ClientCommandRegistrationCallback.EVENT.register((dispatcher, buildContext) -> {
PanoramaCommand.register(dispatcher);
});

var resourceLoader = ResourceManagerHelper.get(PackType.CLIENT_RESOURCES);
resourceLoader.registerReloadListener(BlockSoundGroupManager.INSTANCE);

Expand Down
19 changes: 3 additions & 16 deletions src/main/java/net/frozenblock/lib/FrozenMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.frozenblock.lib.cape.impl.ServerCapeData;
import net.frozenblock.lib.config.api.instance.Config;
Expand All @@ -35,7 +34,6 @@
import net.frozenblock.lib.entrypoint.api.FrozenModInitializer;
import net.frozenblock.lib.event.api.PlayerJoinEvents;
import net.frozenblock.lib.event.api.RegistryFreezeEvents;
import net.frozenblock.lib.ingamedevtools.RegisterInGameDevTools;
import net.frozenblock.lib.integration.api.ModIntegrations;
import net.frozenblock.lib.networking.FrozenNetworking;
import net.frozenblock.lib.particle.api.FrozenParticleTypes;
Expand Down Expand Up @@ -70,16 +68,13 @@
import org.quiltmc.qsl.frozenblock.misc.datafixerupper.impl.ServerFreezer;

public final class FrozenMain extends FrozenModInitializer {
public static boolean INITIALIZED = false;

public FrozenMain() {
super(FrozenSharedConstants.MOD_ID);
}

public static void init() {
if (INITIALIZED) return;
INITIALIZED = true;

@Override
public void onInitialize(String modId, ModContainer container) {
FrozenRegistry.initRegistry();

// QUILT INIT
Expand All @@ -102,16 +97,10 @@ public static void init() {
Registry.register(BuiltInRegistries.MATERIAL_CONDITION, FrozenSharedConstants.id("biome_tag_condition_source"), BiomeTagConditionSource.CODEC.codec());
Registry.register(BuiltInRegistries.MATERIAL_CONDITION, FrozenSharedConstants.id("optimized_biome_tag_condition_source"), OptimizedBiomeTagConditionSource.CODEC.codec());

RegisterInGameDevTools.init();
FrozenParticleTypes.registerParticles();
ServerCapeData.init();

FrozenMainEntrypoint.EVENT.invoker().init(); // includes dev init
}

@Override
public void onInitialize(String modId, ModContainer container) {
init();

ArgumentTypeInfos.register(
BuiltInRegistries.COMMAND_ARGUMENT_TYPE,
Expand All @@ -126,9 +115,7 @@ public void onInitialize(String modId, ModContainer container) {
ConfigCommand.register(dispatcher);
TagListCommand.register(dispatcher);
ScaleEntityCommand.register(dispatcher);
if (FabricLoader.getInstance().isDevelopmentEnvironment()) {
StructureUpgradeCommand.register(dispatcher);
}
StructureUpgradeCommand.register(dispatcher);
});

ServerWorldEvents.LOAD.register((server, level) -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package net.frozenblock.lib.core.client.api;

import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.frozenblock.lib.FrozenSharedConstants;
import net.minecraft.client.Minecraft;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@Environment(EnvType.CLIENT)
public class PanoramaCommand {

public static void register(@NotNull CommandDispatcher<FabricClientCommandSource> dispatcher) {
dispatcher.register(
ClientCommandManager.literal("panorama")
.executes(
context -> {
FrozenSharedConstants.LOGGER.warn("PLAYER HAS ACCESS TO DEV CAMERA AND HAS JUST USED IT");
Minecraft client = Minecraft.getInstance();
File directory = getPanoramaFolderName(new File(client.gameDirectory, "panoramas"));
File directory1 = new File(directory, "screenshots");
directory1.mkdir();
directory1.mkdirs();
client.grabPanoramixScreenshot(directory, 1024, 1024);
return 1;
}
)
);
}

private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");

private static @NotNull File getPanoramaFolderName(File directory) {
String string = DATE_FORMAT.format(new Date());
int i = 1;
while (true) {
File file = new File(directory, string + (i == 1 ? "" : "_" + i));
if (!file.exists()) {
return file;
}
++i;
}
}
}

This file was deleted.

91 changes: 0 additions & 91 deletions src/main/java/net/frozenblock/lib/ingamedevtools/item/Camera.java

This file was deleted.

This file was deleted.

0 comments on commit 88ecf92

Please sign in to comment.