Merge remote-tracking branch 'origin/1.20' into dev/1.20.2

This commit is contained in:
embeddedt 2023-08-03 12:07:48 -04:00
commit 42688757a7
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
6 changed files with 55 additions and 75 deletions

View File

@ -177,17 +177,19 @@ tasks.withType(JavaCompile) {
task generateChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
def details = versionDetails();
def theVersionRef
if(details.commitDistance > 0) {
fromRef = details.lastTag;
theVersionRef = details.lastTag;
} else {
def secondLastTagCmd = "git describe --abbrev=0 " + details.lastTag + "^"
def secondLastTag = secondLastTagCmd.execute().text.trim()
fromRef = secondLastTag;
theVersionRef = secondLastTag;
}
fromRef = theVersionRef
file = new File("CHANGELOG.md");
def otherTemplateContent = new File('gradle/changelog.mustache').getText('UTF-8');
templateContent = "## Changes since " + fromRef + "\n" + otherTemplateContent;
templateContent = new File('gradle/changelog.mustache').getText('UTF-8').replace("[[modernFixVersionRef]]", theVersionRef);
toCommit = "HEAD";
}

View File

@ -17,83 +17,37 @@ import java.util.function.Consumer;
public interface ModernFixPlatformHooks {
ModernFixPlatformHooks INSTANCE = PlatformHookLoader.findInstance();
default boolean isClient() {
throw new AssertionError();
}
boolean isClient();
default boolean isDedicatedServer() {
throw new AssertionError();
}
boolean isDedicatedServer();
default String getVersionString() {
throw new AssertionError();
}
String getVersionString();
boolean modPresent(String modId);
default boolean modPresent(String modId) {
throw new AssertionError();
}
boolean isDevEnv();
default boolean isDevEnv() {
throw new AssertionError();
}
void injectPlatformSpecificHacks();
default void injectPlatformSpecificHacks() {
throw new AssertionError();
}
void applyASMTransformers(String mixinClassName, ClassNode targetClass);
default void applyASMTransformers(String mixinClassName, ClassNode targetClass) {
throw new AssertionError();
}
MinecraftServer getCurrentServer();
default MinecraftServer getCurrentServer() {
throw new AssertionError();
}
boolean isEarlyLoadingNormally();
default boolean isEarlyLoadingNormally() {
throw new AssertionError();
}
boolean isLoadingNormally();
default boolean isLoadingNormally() {
throw new AssertionError();
}
Path getGameDirectory();
default Path getGameDirectory() {
throw new AssertionError();
}
void sendPacket(ServerPlayer player, Object packet);
default void sendPacket(ServerPlayer player, Object packet) {
throw new AssertionError();
}
Multimap<String, String> getCustomModOptions();
default void onServerCommandRegister(Consumer<CommandDispatcher<CommandSourceStack>> handler) {
throw new AssertionError();
}
void onServerCommandRegister(Consumer<CommandDispatcher<CommandSourceStack>> handler);
default Multimap<String, String> getCustomModOptions() {
throw new AssertionError();
}
void onLaunchComplete();
default void registerCreativeSearchTrees(SearchRegistry registry, SearchRegistry.TreeBuilderSupplier<ItemStack> nameSupplier, SearchRegistry.TreeBuilderSupplier<ItemStack> tagSupplier, BiConsumer<SearchRegistry.Key<ItemStack>, List<ItemStack>> populator) {
throw new AssertionError();
}
default void onLaunchComplete() {
throw new AssertionError();
}
void registerCreativeSearchTrees(SearchRegistry registry, SearchRegistry.TreeBuilderSupplier<ItemStack> nameSupplier, SearchRegistry.TreeBuilderSupplier<ItemStack> tagSupplier, BiConsumer<SearchRegistry.Key<ItemStack>, List<ItemStack>> populator);
default String getPlatformName() {
throw new AssertionError();
}
String getPlatformName();
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -1,3 +1,7 @@
Depending on the size of this release, there may be a human-readable changelog available on [the wiki page](https://github.com/embeddedt/ModernFix/wiki/Changelog).
## Changes since [[modernFixVersionRef]]
{{#commits}}
{{#ifMatches messageTitle "^(?!Merge).*"}}
* [{{{messageTitle}}}](https://github.com/embeddedt/ModernFix/commit/{{hashFull}}) - {{{authorName}}}

View File

@ -1,2 +1,2 @@
#!/bin/bash
git ls-remote --heads origin | awk '{print $2}' | sed 's:.*/::' | sort -V | grep -E '^1\.[0-9]*(\.[0-9]*)?$'
git ls-remote --heads origin | awk '{print $2}' | grep -E '^refs/heads/1\.' | sed 's:.*/::' | sort -V | grep -E '^1\.[0-9]*(\.[0-9]*)?$'