diff --git a/src/main/java/com/terraformersmc/campanion/config/CampanionConfig.java b/src/main/java/com/terraformersmc/campanion/config/CampanionConfig.java index 0c42b39e..0c01b692 100644 --- a/src/main/java/com/terraformersmc/campanion/config/CampanionConfig.java +++ b/src/main/java/com/terraformersmc/campanion/config/CampanionConfig.java @@ -2,6 +2,9 @@ public class CampanionConfig { + public boolean renderTentContents = true; + public boolean renderTentPlacement = true; + public CampanionConfig() {} } diff --git a/src/main/java/com/terraformersmc/campanion/mixin/client/MixinItemRenderer.java b/src/main/java/com/terraformersmc/campanion/mixin/client/MixinItemRenderer.java index 1799f9c9..d42498e7 100644 --- a/src/main/java/com/terraformersmc/campanion/mixin/client/MixinItemRenderer.java +++ b/src/main/java/com/terraformersmc/campanion/mixin/client/MixinItemRenderer.java @@ -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; @@ -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(); + } + } } } diff --git a/src/main/java/com/terraformersmc/campanion/mixin/client/MixinWorldRenderer.java b/src/main/java/com/terraformersmc/campanion/mixin/client/MixinWorldRenderer.java index 48e050eb..86b8140f 100644 --- a/src/main/java/com/terraformersmc/campanion/mixin/client/MixinWorldRenderer.java +++ b/src/main/java/com/terraformersmc/campanion/mixin/client/MixinWorldRenderer.java @@ -2,8 +2,8 @@ import com.terraformersmc.campanion.client.renderer.item.BuiltTentItemRenderer; import com.terraformersmc.campanion.client.util.TentPreviewImmediate; +import com.terraformersmc.campanion.config.CampanionConfigManager; import com.terraformersmc.campanion.item.PlaceableTentItem; -import com.terraformersmc.campanion.item.TentBagItem; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.Material; @@ -58,7 +58,9 @@ public void render(MatrixStack matrices, float tickDelta, long limitTime, boolea List list = tent.getErrorPosition(this.client.world, placePos, stack); TentPreviewImmediate.STORAGE.setApplyModifiers(!list.isEmpty()); - BuiltTentItemRenderer.INSTANCE.render(stack, matrices, placePos, immediate, -1); + if (CampanionConfigManager.getConfig().renderTentPlacement) { + BuiltTentItemRenderer.INSTANCE.render(stack, matrices, placePos, immediate, -1); + } for (BlockPos pos : list) { matrices.push();