Skip to content

Commit

Permalink
1.21.2/3
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Oct 25, 2024
1 parent 42a016e commit e9a1357
Show file tree
Hide file tree
Showing 13 changed files with 543 additions and 344 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Change
- sync from 1.21-0.21.1-sakura.1
- add raw NBT support for inventoryOverlay/Preview code from Snapshot, and the related "Library" of NBT helper functions listed under BlockUtils and EntityUtils, along with Fully NBT compliant getNbtItems(), and getNbtInventory() functions under InventoryUtils.
- This also adds a new InventoryOverlay.Context as a place holder Object for InventoryOverlay data.
- add "locked slots" rendering support for inventoryPreview for Crafters
- Update to 1.21.2/1.21.3 (#57) @QiuShui1012
- sync from 1.21.3-0.22.0-sakura.1~sakura.2
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
minecraft_version="1.21.3"
yarn_mappings="1.21.3+build.2"
mappings_patch="1.21+build.4"
neoforge="21.3.0-beta"
neoforge="21.3.2-beta"

# Mod properties
version="0.1.24"
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/fi/dy/masa/malilib/MaLiLibConfigGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ else if (tab == ConfigGuiTab.DEBUG)
{
configs = MaLiLibConfigs.Debug.OPTIONS;
}
/*
else if (tab == ConfigGuiTab.TEST)
{
configs = MaLiLibConfigs.Test.OPTIONS;
}
*/
else
{
return Collections.emptyList();
Expand Down Expand Up @@ -104,6 +110,7 @@ public enum ConfigGuiTab
{
GENERIC ("malilib.gui.title.generic"),
DEBUG ("malilib.gui.title.debug");
//TEST ("malilib.gui.title.test");

private final String translationKey;

Expand Down
36 changes: 36 additions & 0 deletions src/main/java/fi/dy/masa/malilib/MaLiLibConfigs.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,40 @@ public static class Debug
);
}

/*
private static final String TEST_KEY = MaLiLibReference.MOD_ID+".config.test";
public static class Test
{
public static final ConfigBoolean TEST_CONFIG_BOOLEAN = new ConfigBoolean("testBoolean", false, "Test Boolean").apply(TEST_KEY);
public static final ConfigBooleanHotkeyed TEST_CONFIG_BOOLEAN_HOTKEYED = new ConfigBooleanHotkeyed("testBooleanHotkeyed", false, "", "Test Boolean Hotkeyed").apply(TEST_KEY);
public static final ConfigColor TEST_CONFIG_COLOR = new ConfigColor("testColor", "0x3022FFFF", "Test Color").apply(TEST_KEY);
public static final ConfigColorList TEST_CONFIG_COLOR_LIST = new ConfigColorList("testColorList", ImmutableList.of(new Color4f(0, 0, 0), new Color4f(255,255,255,255)), "Test Color List").apply(TEST_KEY);
public static final ConfigDouble TEST_CONFIG_DOUBLE = new ConfigDouble("testDouble", 0.5, 0, 1, true, "Test Double").apply(TEST_KEY);
public static final ConfigFloat TEST_CONFIG_FLOAT = new ConfigFloat("testFloat", 0.5f, 0.0f, 1.0f, true, "Test Float").apply(TEST_KEY);
public static final ConfigHotkey TEST_CONFIG_HOTKEY = new ConfigHotkey("testHotkey", "", "Test Hotkey").apply(TEST_KEY);
public static final ConfigInteger TEST_CONFIG_INTEGER = new ConfigInteger("testInteger", 0, "Test Integer").apply(TEST_KEY);
public static final ConfigOptionList TEST_CONFIG_OPTIONS_LIST = new ConfigOptionList("testOptionList", ConfigTestOptList.TEST1, "Test Option List").apply(TEST_KEY);
public static final ConfigString TEST_CONFIG_STRING = new ConfigString("testString", "testString", "Test String").apply(TEST_KEY);
public static final ConfigStringList TEST_CONFIG_STRING_LIST = new ConfigStringList("testStringList", ImmutableList.of("testString1", "testString2"), "Test String List").apply(TEST_KEY);
public static final ConfigLockedList TEST_CONFIG_LOCKED_LIST = new ConfigLockedList("testLockedConfigList", ConfigTestLockedList.INSTANCE, "Test Locked List").apply(TEST_KEY);
public static final ImmutableList<IConfigBase> OPTIONS = ImmutableList.of(
TEST_CONFIG_BOOLEAN,
TEST_CONFIG_BOOLEAN_HOTKEYED,
TEST_CONFIG_COLOR,
TEST_CONFIG_COLOR_LIST,
TEST_CONFIG_DOUBLE,
TEST_CONFIG_FLOAT,
TEST_CONFIG_HOTKEY,
TEST_CONFIG_INTEGER,
TEST_CONFIG_OPTIONS_LIST,
TEST_CONFIG_STRING,
TEST_CONFIG_STRING_LIST,
TEST_CONFIG_LOCKED_LIST
);
}
*/

public static void loadFromFile()
{
File configFile = new File(FileUtils.getConfigDirectory(), CONFIG_FILE_NAME);
Expand All @@ -65,6 +99,7 @@ public static void loadFromFile()

ConfigUtils.readConfigBase(root, "Generic", Generic.OPTIONS);
ConfigUtils.readConfigBase(root, "Debug", Debug.OPTIONS);
//ConfigUtils.readConfigBase(root, "Test", Test.OPTIONS);
}
}
}
Expand All @@ -79,6 +114,7 @@ public static void saveToFile()

ConfigUtils.writeConfigBase(root, "Generic", Generic.OPTIONS);
ConfigUtils.writeConfigBase(root, "Debug", Debug.OPTIONS);
//ConfigUtils.writeConfigBase(root, "Test", Test.OPTIONS);

JsonUtils.writeJsonToFile(root, new File(dir, CONFIG_FILE_NAME));
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/fi/dy/masa/malilib/MaLiLibInitHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ public void registerModHandlers()

InputEventHandler.getKeybindManager().registerKeybindProvider(MaLiLibInputHandler.getInstance());
MaLiLibConfigs.Generic.OPEN_GUI_CONFIGS.getKeybind().setCallback(new CallbackOpenConfigGui());

/*
IRenderer renderer = new TestRenderHandler();
RenderEventHandler.getInstance().registerGameOverlayRenderer(renderer);
RenderEventHandler.getInstance().registerTooltipLastRenderer(renderer);
RenderEventHandler.getInstance().registerWorldPreWeatherRenderer(renderer);
RenderEventHandler.getInstance().registerWorldLastRenderer(renderer);
*/
}

private static class CallbackOpenConfigGui implements IHotkeyCallback
Expand Down
15 changes: 6 additions & 9 deletions src/main/java/fi/dy/masa/malilib/mixin/MixinWorldRenderer.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package fi.dy.masa.malilib.mixin;

import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.util.profiler.Profilers;
import org.joml.Matrix4f;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.PostEffectProcessor;
import net.minecraft.client.render.*;
import net.minecraft.client.util.ObjectAllocator;
import net.minecraft.util.profiler.Profiler;
Expand All @@ -29,15 +27,14 @@ public abstract class MixinWorldRenderer

@Inject(method = "render",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/render/WorldRenderer;addWeatherPass(Lnet/minecraft/client/render/FrameGraphBuilder;Lnet/minecraft/client/render/LightmapTextureManager;Lnet/minecraft/util/math/Vec3d;FLnet/minecraft/client/render/Fog;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/client/render/Camera;)V",
target = "Lnet/minecraft/client/render/WorldRenderer;addParticlesPass(Lnet/minecraft/client/render/FrameGraphBuilder;Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/LightmapTextureManager;FLnet/minecraft/client/render/Fog;Lnet/minecraft/client/render/Frustum;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;)V",
shift = At.Shift.BEFORE))
private void malilib_onRenderWorldPreWeather(ObjectAllocator allocator, RenderTickCounter tickCounter,
boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer,
LightmapTextureManager lightmapTextureManager, Matrix4f positionMatrix,
Matrix4f projectionMatrix, CallbackInfo ci,
private void malilib_onRenderWorldPreWeather(ObjectAllocator allocator, RenderTickCounter tickCounter, boolean bl,
Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager,
Matrix4f positionMatrix, Matrix4f projectionMatrix, CallbackInfo ci,
@Local Profiler profiler, @Local Frustum frustum,
@Local FrameGraphBuilder frameGraphBuilder,
@Local Frustum frustum,
@Local Profiler profiler)
@Local(ordinal = 0) int i, @Local(ordinal = 1) int j)
{
((RenderEventHandler) RenderEventHandler.getInstance()).runRenderWorldPreWeather(positionMatrix, projectionMatrix, this.client, frameGraphBuilder, this.framebufferSet, frustum, camera, profiler);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public interface IPluginClientPlayHandler<T extends CustomPayload> extends Packe
void reset(Identifier channel);

/**
* Register your Payload with BadPackets.
* See the BadPackets Java Docs under PlayPackets -> registerServerChannel() and PlayPackets -> registerClientChannel()
* Register your Payload with Fabric API.
* See the fabric-networking-api-v1 Java Docs under PayloadTypeRegistry -> register()
* for more information on how to do this.
* -
* @param id (Your Payload Id<T>)
Expand Down Expand Up @@ -235,4 +235,4 @@ default boolean sendPlayPayload(@Nonnull ClientPlayNetworkHandler handler, @Nonn

return false;
}
}
}
56 changes: 56 additions & 0 deletions src/main/resources/assets/mafglib/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"malilib.config.name.ignoredKeys": "ignoredKeys",
"malilib.config.name.openGuiConfigs": "openGuiConfigs",
"malilib.config.name.realmsCommonConfig": "realmsCommonConfig",
"malilib.config.name.enableActionbarMessages": "enableActionbarMessages",

"malilib.config.name.debugMessages": "debugMessages",
"malilib.config.name.inputCancellationDebugging": "inputCancellationDebugging",
"malilib.config.name.keybindDebugging": "keybindDebugging",
Expand All @@ -11,6 +13,19 @@
"malilib.config.comment.ignoredKeys": "Any keys set here will be completely ignored",
"malilib.config.comment.openGuiConfigs": "Open the in-game malilib config GUI",
"malilib.config.comment.realmsCommonConfig": "Whether or not to use a common config file name for all realms servers.\nIf this is disabled, then the server IP and port are used in the generated config file names.\nHowever, apparently the Realms server addresses change regularly, so the config names would change\nall the time and thus the configs wouldn't save properly.\nSo basically leave this enabled if you only play on one Realms server.\nIf you play on multiple Realms... then the configs will get mixed up regardless.\nUnless you play on the different servers on different Minecraft instances\nto keep the configs separated by the Minecraft instance.",
"malilib.config.comment.enableActionbarMessages": "Whether or not to display Actionbar Messages.\nThis setting may be useful for\nRecording or Streaming purposes.\nInspired by the \"Streamer Mode\" mod by Sakura.",

"malilib.config.prettyName.ignoredKeys": "Ignored Keys",
"malilib.config.prettyName.openGuiConfigs": "Open Gui Configs",
"malilib.config.prettyName.realmsCommonConfig": "Realms Common Config",
"malilib.config.prettyName.enableActionbarMessages": "Actionbar Messages",

"malilib.config.prettyName.debugMessages": "Debug Messages",
"malilib.config.prettyName.inputCancellationDebugging": "Input Cancellation Debugging",
"malilib.config.prettyName.keybindDebugging": "Keybind Debugging",
"malilib.config.prettyName.keybindDebuggingIngame": "Keybind Debugging In-Game",
"malilib.config.prettyName.mouseScrollDebug": "Mouse Scroll Debug",

"malilib.config.comment.debugMessages": "When enabled, debug level events\nare printed to the game console/log",
"malilib.config.comment.inputCancellationDebugging": "When enabled, then the cancellation reason/source\nfor inputs (keyboard and mouse) is printed out",
"malilib.config.comment.keybindDebugging": "When enabled, key presses and held keys are\nprinted to the game console (and the action bar, if enabled)",
Expand All @@ -30,6 +45,8 @@
"malilib.error.invalid_directory": "Invalid directory name '%s'",
"malilib.error.invalid_block_blacklist_entry": "Invalid block in a black- or whitelist: '%s'",
"malilib.error.invalid_item_blacklist_entry": "Invalid item name in a black- or whitelist: '%s'",
"malilib.error.invalid_item_stack_entry.string": "Invalid item stack string: '%s'",
"malilib.error.invalid_item_stack_entry.nbt_syntax": "Invalid item stack NBT syntax: '%s'",

"malilib.gui.button.cancel": "Cancel",
"malilib.gui.button.ok": "OK",
Expand All @@ -40,6 +57,11 @@
"malilib.gui.button.render_layers_gui.layers": "Layers: %s",
"malilib.gui.button.render_layers_gui.set_here": "Set Here",

"malilib.gui.button.hovertext.add": "Add",
"malilib.gui.button.hovertext.remove": "Remove",
"malilib.gui.button.hovertext.move_up": "Move Up",
"malilib.gui.button.hovertext.move_down": "Move Down",

"malilib.gui.button.hover.directory_widget.create_directory": "Create a new directory",
"malilib.gui.button.hover.directory_widget.root": "To root/base directory",
"malilib.gui.button.hover.directory_widget.up": "Up to parent directory",
Expand Down Expand Up @@ -88,6 +110,7 @@
"malilib.gui.title.create_directory": "Create a new directory",
"malilib.gui.title.debug": "Debug",
"malilib.gui.title.generic": "Generic",
"malilib.gui.title.test": "Test",
"malilib.gui.title.keybind_settings.advanced": "Advanced Keybind Settings for %s",
"malilib.gui.title.locked_list_edit": "Edit locked list for '%s'",
"malilib.gui.title.string_list_edit": "Edit string list for '%s'",
Expand Down Expand Up @@ -126,6 +149,39 @@
"malilib.message.formatting_code.success": "§a",
"malilib.message.formatting_code.warning": "§6",

"malilib.config.test.name.testBoolean": "testBoolean /X",
"malilib.config.test.name.testBooleanHotkeyed": "testBooleanHotkeyed /X",
"malilib.config.test.name.testColor": "testColor /X",
"malilib.config.test.name.testColorList": "testColorList /X",
"malilib.config.test.name.testDouble": "testDouble /X",
"malilib.config.test.name.testFloat": "testFloat /X",
"malilib.config.test.name.testHotkey": "testHotkey /X",
"malilib.config.test.name.testInteger": "testInteger /X",
"malilib.config.test.name.testOptionList": "testOptionList /X",
"malilib.config.test.name.testString": "testString /X",
"malilib.config.test.name.testStringList": "testStringList /X",
"malilib.config.test.name.testLockedConfigList": "testLockedConfigList /X",
"malilib.config.test.name.testSyncEnable": "testSyncEnable",

"malilib.config.test.comment.testBoolean": "[X] testBoolean Comment!",
"malilib.config.test.comment.testBooleanHotkeyed": "[X] testBooleanHotkeyed Comment!",
"malilib.config.test.comment.testColor": "[X] testColor Comment!",
"malilib.config.test.comment.testColorList": "[X] testColorList Comment!",
"malilib.config.test.comment.testDouble": "[X] testDouble Comment!",
"malilib.config.test.comment.testFloat": "[X] testFloat Comment!",
"malilib.config.test.comment.testHotkey": "[X] testHotkey Comment!",
"malilib.config.test.comment.testInteger": "[X] testInteger Comment!",
"malilib.config.test.comment.testOptionList": "[X] testOptionList Comment!",
"malilib.config.test.comment.testString": "[X] testString Comment!",
"malilib.config.test.comment.testStringList": "[X] testStringList Comment!",
"malilib.config.test.comment.testLockedConfigList": "[X] testLockedConfigList Comment!",
"malilib.config.test.comment.testSyncEnable": "Enable the Testing Only 'DataSync' Service",

"malilib.gui.label.locked_test.test1": "Test # 1",
"malilib.gui.label.locked_test.test2": "Test # 2",
"malilib.gui.label.locked_test.test3": "Test # 3",
"malilib.gui.label.locked_test.test4": "Test # 4",

"malilib.message.layer_range.range_max": "max",
"malilib.message.layer_range.range_min": "min",
"malilib.message.moved_layer_range": "Moved the entire layer range by §a%s§r on the §a%s§r axis",
Expand Down
Loading

0 comments on commit e9a1357

Please sign in to comment.