Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.20.6' into 1.21
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/main/java/org/figuramc/figura/lua/api/RendererAPI.java
  • Loading branch information
UnlikePaladin committed Sep 3, 2024
2 parents 7c539ba + 6e64ca1 commit 80517f9
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public class LocalAvatarLoader {

String namespace = split[split.length - 2];
String path = split[split.length - 1];
ResourceLocation id = new ResourceLocation(namespace, path.substring(0, path.length() - 5));
// This is a 4 because .nbt has 4 characters
ResourceLocation id = new ResourceLocation(namespace, path.substring(0, path.length() - 4));

// nbt
CompoundTag nbt;
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/java/org/figuramc/figura/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ public void onChange() {
}};
public static final ConfigType.BoolConfig
ALLOW_FP_HANDS = new ConfigType.BoolConfig("allow_fp_hands", RENDERING, false),
FIRST_PERSON_MATRICES = new ConfigType.BoolConfig("first_person_matrices", RENDERING, true);
FIRST_PERSON_MATRICES = new ConfigType.BoolConfig("first_person_matrices", RENDERING, true),
INVENTORY_SCISSOR = new ConfigType.BoolConfig("inventory_scissor", RENDERING, true);


// -- ACTION WHEEL -- //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public RendererAPI cameraNormal(FiguraMat3 matrix) {
)
public RendererAPI setPostEffect(String effect) {
this.postShader = effect == null ? null : LuaUtils.parsePath("shaders/post/" + effect + ".json");
if (Minecraft.getInstance().getResourceManager().getResource(postShader).isEmpty())
if (postShader != null && Minecraft.getInstance().getResourceManager().getResource(postShader).isEmpty())
throw new LuaError("The post shader %s does not exist or could not be found".formatted(postShader.toString()));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ private static void renderEntityInInventoryFollowsMouse(GuiGraphics guiGraphics,
float yaw = h - mouseY;
Vector3f modelOffset = new Vector3f(0.0F, -(entity.getBbHeight() / 2.0F + yOffset), 0);

// Scissor is disabled here as enabling it would cut off nameplate rendering and taller models.
// guiGraphics.enableScissor(x, y, i, j);
if (Configs.INVENTORY_SCISSOR.value) {
guiGraphics.enableScissor(x, y, i, j);
}
UIHelper.drawEntity(g, h, size, (float) Math.atan(yaw / 40f) * 20f, (float) -Math.atan(pitch / 40f) * 20f, entity, guiGraphics, modelOffset, EntityRenderMode.MINECRAFT_GUI);
// guiGraphics.disableScissor();
if (Configs.INVENTORY_SCISSOR.value) {
guiGraphics.disableScissor();
}
ci.cancel();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.figuramc.figura.mixin.gui;

import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style;
import org.figuramc.figura.FiguraMod;
import org.figuramc.figura.avatar.Avatar;
Expand Down Expand Up @@ -34,8 +36,12 @@ private void handleComponentClicked(Style style, CallbackInfoReturnable<Boolean>
Avatar avatar = AvatarManager.getAvatarForPlayer(FiguraMod.getLocalPlayerUUID());
if (avatar == null)
return;

LuaValue value = avatar.loadScript("figura_function", event.getValue());
LuaValue value = null;
try {
value = avatar.loadScript("figura_function", event.getValue());
} catch (Exception e) {
FiguraMod.sendChatMessage(Component.literal(e.getMessage()).withStyle(Style.EMPTY.withColor(ChatFormatting.RED).withBold(true)));
}
if (value != null)
avatar.run(value, avatar.tick);
}
Expand Down
3 changes: 3 additions & 0 deletions common/src/main/resources/assets/figura/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@
"figura.config.render_debug_parts_pivot.1.tooltip": "Do not render pivots",
"figura.config.render_debug_parts_pivot.2.tooltip": "Render pivots of only the Host Avatar",
"figura.config.render_debug_parts_pivot.3.tooltip": "Render pivots of all Avatars",

"figura.config.inventory_scissor": "Render Inventory with Scissors",
"figura.config.inventory_scissor.tooltip": "Enabling this stops the player from rendering outside of the inventory entity view box.",
"figura.config.first_person_matrices": "First Person Matrices",
"figura.config.first_person_matrices.tooltip": "Toggles if the model part matrices should be updated while in first person",
"figura.config.action_wheel": "Action Wheel",
Expand Down
4 changes: 4 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ void setupRepositories(RepositoryHandler repositories) {
}
}

configurations.configureEach {
resolutionStrategy.force("net.sf.jopt-simple:jopt-simple:5.0.4")
}

// From the Forge MDK's buildscript, this is temporary until arch loom does it for us
// Merge the resources and classes into the same directory.
// This is done because java expects modules to be in a single directory.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mappings = 2
enabled_platforms = fabric,forge,neoforge

# Mod Properties
mod_version = 0.1.5-rc.1
mod_version = 0.1.5-rc.2
maven_group = org.figuramc
archives_base_name = figura
assets_version = v2
Expand Down

0 comments on commit 80517f9

Please sign in to comment.