mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 07:27:15 +01:00
Merge pull request #6796 from IThundxr/mc1.20.1/override-fix
Fix potential issue caused by soft override
This commit is contained in:
commit
b8a329d021
3 changed files with 25 additions and 10 deletions
|
@ -2,6 +2,8 @@ package com.simibubi.create.content.trains.station;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.simibubi.create.foundation.mixin.accessor.FontAccessor;
|
||||
|
||||
import org.joml.Matrix4f;
|
||||
|
||||
import net.minecraft.client.StringSplitter;
|
||||
|
@ -18,14 +20,10 @@ public class NoShadowFontWrapper extends Font {
|
|||
private Font wrapped;
|
||||
|
||||
public NoShadowFontWrapper(Font wrapped) {
|
||||
super(null, false);
|
||||
super(((FontAccessor) wrapped).create$getFonts(), false);
|
||||
this.wrapped = wrapped;
|
||||
}
|
||||
|
||||
public FontSet getFontSet(ResourceLocation pFontLocation) {
|
||||
return wrapped.getFontSet(pFontLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int drawInBatch(Component pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pMatrix,
|
||||
MultiBufferSource pBuffer, DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) {
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package com.simibubi.create.foundation.mixin.accessor;
|
||||
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.font.FontSet;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Mixin(Font.class)
|
||||
public interface FontAccessor {
|
||||
@Accessor("fonts")
|
||||
Function<ResourceLocation, FontSet> create$getFonts();
|
||||
}
|
|
@ -27,6 +27,7 @@
|
|||
],
|
||||
"client": [
|
||||
"accessor.AgeableListModelAccessor",
|
||||
"accessor.FontAccessor",
|
||||
"accessor.GameRendererAccessor",
|
||||
"accessor.HumanoidArmorLayerAccessor",
|
||||
"accessor.MouseHandlerAccessor",
|
||||
|
|
Loading…
Reference in a new issue