Merge 1.18 into 1.19.2

This commit is contained in:
embeddedt 2023-11-23 10:12:18 -05:00
commit bf43ba7bf4
2 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package org.embeddedt.modernfix.common.mixin.bugfix.buffer_builder_leak;
import com.mojang.blaze3d.vertex.BufferBuilder;
import org.embeddedt.modernfix.ModernFix;
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
import org.embeddedt.modernfix.render.UnsafeBufferHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@ -12,6 +13,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.nio.ByteBuffer;
@Mixin(BufferBuilder.class)
@ClientOnlyMixin
public class BufferBuilderMixin {
@Shadow private ByteBuffer buffer;

View File

@ -61,6 +61,13 @@ public class CachedResourcePath {
* DOES NOT INTERN!
*/
public CachedResourcePath(String[] pathComponents) {
for(String s : pathComponents) {
if(s.length() == 0) {
// reconstruct the whole array skipping blanks. inefficient, but should not be the common case
pathComponents = Arrays.stream(pathComponents).filter(comp -> comp.length() > 0).toArray(String[]::new);
break;
}
}
this.pathComponents = pathComponents;
}