diff options
author | SHsuperCM <shsupercm@gmail.com> | 2021-10-15 18:01:22 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2021-10-15 18:01:22 +0300 |
commit | 4530fd7aba852b0ad47866ecef1f52764b5a4dfc (patch) | |
tree | cbe49f98f689dcbc797ab19b088eec59d3e9348f /src/main/java/shcm/shsupercm/fabric/citresewn | |
parent | ccd310d0f6432126b98558aeb1ae59bc25482d76 (diff) | |
download | CITResewn-4530fd7aba852b0ad47866ecef1f52764b5a4dfc.tar.gz CITResewn-4530fd7aba852b0ad47866ecef1f52764b5a4dfc.tar.bz2 CITResewn-4530fd7aba852b0ad47866ecef1f52764b5a4dfc.zip |
Global Properties' enchantment cap
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java | 10 |
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); } } |