Skip to content

Commit

Permalink
add basic config, allow f u n k y backpack rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
gliscowo committed Jan 22, 2023
1 parent 64aa631 commit 72db0d4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

src/main/generated
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {

modImplementation "dev.emi:trinkets:${project.trinkets_version}"

modImplementation "io.wispforest:owo-lib:${project.owo_version}"
modImplementation annotationProcessor("io.wispforest:owo-lib:${project.owo_version}")
include "io.wispforest:owo-sentinel:${project.owo_version}"

// dev utils
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/wispforest/outthedoor/OutTheDoor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.wispforest.outthedoor;

import io.wispforest.outthedoor.misc.BackpackType;
import io.wispforest.outthedoor.misc.OutTheDoorConfig;
import io.wispforest.outthedoor.object.OutTheDoorBackpackTypes;
import io.wispforest.outthedoor.object.OutTheDoorBlocks;
import io.wispforest.outthedoor.object.OutTheDoorItems;
Expand All @@ -19,6 +20,7 @@ public class OutTheDoor implements ModInitializer {
public static final String MOD_ID = "out-the-door";

public static final OwoNetChannel CHANNEL = OwoNetChannel.create(id("network"));
public static final OutTheDoorConfig CONFIG = OutTheDoorConfig.createAndLoad();

public static final OwoItemGroup GROUP = OwoItemGroup
.builder(id("out-the-door"), () -> Icon.of(OutTheDoorItems.LEATHER_BACKPACK))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ public void onInitializeClient() {

//noinspection unchecked
TrinketRenderer.translateToChest(matrices, (PlayerEntityModel<AbstractClientPlayerEntity>) contextModel, player);
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(180));
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
matrices.translate(0, 0, -.375);
if (!OutTheDoor.CONFIG.funkyBackpacks()) {
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(180));
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
matrices.translate(0, 0, -.375);
}

MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformation.Mode.FIXED, light, OverlayTexture.DEFAULT_UV, matrices, vertexConsumers, 0);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.wispforest.outthedoor.misc;

import io.wispforest.owo.config.annotation.Config;
import io.wispforest.owo.config.annotation.Modmenu;

@Modmenu(modId = "out-the-door")
@Config(name = "out-the-door", wrapperName = "OutTheDoorConfig")
public class OutTheDoorConfigModel {

public boolean funkyBackpacks = false;

}
5 changes: 4 additions & 1 deletion src/main/resources/assets/out-the-door/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"item.out-the-door.hide_backpack": "Hide Backpack",
"item.out-the-door.pumpkin_backpack": "Pumpkin Backpack",

"key.out-the-door.openBackpack": "Open Backpack"
"key.out-the-door.openBackpack": "Open Backpack",

"text.config.out-the-door.title": "Out the Door - Configuration",
"text.config.out-the-door.option.funkyBackpacks": "Funky Backpacks"
}

0 comments on commit 72db0d4

Please sign in to comment.