Merge 1.19.4 into 1.20
This commit is contained in:
commit
19593b5574
|
|
@ -4,15 +4,16 @@ import net.minecraft.client.gui.components.DebugScreenOverlay;
|
|||
import org.embeddedt.modernfix.ModernFixClientFabric;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(DebugScreenOverlay.class)
|
||||
public class GuiMixin {
|
||||
@Inject(method = "getGameInformation", at = @At("RETURN"))
|
||||
private void addModernFix(CallbackInfoReturnable<List<String>> cir) {
|
||||
cir.getReturnValue().add(ModernFixClientFabric.commonMod.brandingString);
|
||||
@ModifyVariable(method = "getSystemInformation", at = @At("STORE"), ordinal = 0, require = 0)
|
||||
private List<String> addModernFix(List<String> list) {
|
||||
list.add("");
|
||||
list.add(ModernFixClientFabric.commonMod.brandingString);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
|
|||
import org.embeddedt.modernfix.ModernFixClient;
|
||||
import org.embeddedt.modernfix.screen.ModernFixConfigScreen;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ModernFixClientForge {
|
||||
private static ModernFixClient commonMod;
|
||||
|
||||
|
|
@ -48,11 +51,27 @@ public class ModernFixClientForge {
|
|||
}
|
||||
}
|
||||
|
||||
private static final List<String> brandingList = new ArrayList<>();
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onRenderOverlay(CustomizeGuiOverlayEvent.DebugText event) {
|
||||
if(commonMod.brandingString != null && Minecraft.getInstance().options.renderDebug) {
|
||||
event.getLeft().add("");
|
||||
event.getLeft().add(commonMod.brandingString);
|
||||
if(brandingList.size() == 0) {
|
||||
brandingList.add("");
|
||||
brandingList.add(commonMod.brandingString);
|
||||
}
|
||||
int targetIdx = 0, numSeenBlanks = 0;
|
||||
List<String> right = event.getRight();
|
||||
while(targetIdx < right.size()) {
|
||||
String s = right.get(targetIdx);
|
||||
if(s == null || s.length() == 0) {
|
||||
numSeenBlanks++;
|
||||
}
|
||||
if(numSeenBlanks == 3)
|
||||
break;
|
||||
targetIdx++;
|
||||
}
|
||||
right.addAll(targetIdx, brandingList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user