aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2021-10-15 18:01:22 +0300
committerSHsuperCM <shsupercm@gmail.com>2021-10-15 18:01:22 +0300
commit4530fd7aba852b0ad47866ecef1f52764b5a4dfc (patch)
treecbe49f98f689dcbc797ab19b088eec59d3e9348f /src/main
parentccd310d0f6432126b98558aeb1ae59bc25482d76 (diff)
downloadCITResewn-4530fd7aba852b0ad47866ecef1f52764b5a4dfc.tar.gz
CITResewn-4530fd7aba852b0ad47866ecef1f52764b5a4dfc.tar.bz2
CITResewn-4530fd7aba852b0ad47866ecef1f52764b5a4dfc.zip
Global Properties' enchantment cap
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java
index 2458646..b3b344a 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java
@@ -4,6 +4,7 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.*;
import net.minecraft.resource.ResourceType;
import net.minecraft.util.Identifier;
+import shcm.shsupercm.fabric.citresewn.CITResewn;
import shcm.shsupercm.fabric.citresewn.ex.CITParseException;
import shcm.shsupercm.fabric.citresewn.mixin.citenchantment.BufferBuilderStorageAccessor;
import shcm.shsupercm.fabric.citresewn.mixin.citenchantment.RenderPhaseAccessor;
@@ -161,13 +162,14 @@ public class CITEnchantment extends CIT {
if (!shouldApply || appliedContext == null)
return null;
- VertexConsumer applied = VertexConsumers.union(appliedContext.stream()
- .map(cit -> provider.getBuffer(cit.renderLayers.get(GlintRenderLayer.this)))
- .toArray(VertexConsumer[]::new));
+ VertexConsumer[] layers = new VertexConsumer[Math.min(appliedContext.size(), CITResewn.INSTANCE.activeCITs.effectiveGlobalProperties.cap)];
+
+ for (int i = 0; i < layers.length; i++)
+ layers[i] = provider.getBuffer(appliedContext.get(i).renderLayers.get(GlintRenderLayer.this));
provider.getBuffer(baseLayer); // refresh base layer for armor consumer
- return base == null ? applied : VertexConsumers.union(applied, base);
+ return base == null ? VertexConsumers.union(layers) : VertexConsumers.union(VertexConsumers.union(layers), base);
}
}