Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config options #139

Open
wants to merge 2 commits into
base: 1.16
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make held tent bag fancy rendering a config option
  • Loading branch information
hugeblank committed May 31, 2021
commit fd78c095b0f0a68aed3f9d5b12aa2240c5b9897e
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class CampanionConfig {

public boolean renderTentContents = true;

public CampanionConfig() {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.terraformersmc.campanion.client.renderer.item.BuiltTentItemRenderer;
import com.terraformersmc.campanion.client.renderer.item.SpearItemRenderer;
import com.terraformersmc.campanion.config.CampanionConfigManager;
import com.terraformersmc.campanion.item.CampanionItems;
import com.terraformersmc.campanion.item.SpearItem;
import net.minecraft.block.Blocks;
Expand Down Expand Up @@ -29,16 +30,16 @@ public void renderItem(LivingEntity entity, ItemStack stack, ModelTransformation
if(stack.getItem() instanceof SpearItem && SpearItemRenderer.INSTANCE.render(entity, stack, renderMode, leftHanded, matrices, vertexConsumers, light, overlay, model)) {
info.cancel();
}
if(stack.getItem() == CampanionItems.TENT_BAG && renderMode != ModelTransformation.Mode.GUI) {
matrices.push();
matrices.scale(1/4F, 1/4F, 1/4F);
MinecraftClient.getInstance().getBlockRenderManager().getModel(Blocks.STONE.getDefaultState()).getTransformation().getTransformation(renderMode).apply(leftHanded, matrices);
boolean ret = BuiltTentItemRenderer.INSTANCE.render(stack, matrices, BlockPos.ORIGIN.up(500), vertexConsumers, light);
matrices.pop();
if(ret) {
info.cancel();
}
}
if(CampanionConfigManager.getConfig().renderTentContents && stack.getItem() == CampanionItems.TENT_BAG && renderMode != ModelTransformation.Mode.GUI) {
matrices.push();
matrices.scale(1/4F, 1/4F, 1/4F);
MinecraftClient.getInstance().getBlockRenderManager().getModel(Blocks.STONE.getDefaultState()).getTransformation().getTransformation(renderMode).apply(leftHanded, matrices);
boolean ret = BuiltTentItemRenderer.INSTANCE.render(stack, matrices, BlockPos.ORIGIN.up(500), vertexConsumers, light);
matrices.pop();
if(ret) {
info.cancel();
}
}
}

}