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

View File

@ -17,83 +17,37 @@ import java.util.function.Consumer;
public interface ModernFixPlatformHooks { public interface ModernFixPlatformHooks {
ModernFixPlatformHooks INSTANCE = PlatformHookLoader.findInstance(); ModernFixPlatformHooks INSTANCE = PlatformHookLoader.findInstance();
default boolean isClient() { boolean isClient();
throw new AssertionError();
}
boolean isDedicatedServer();
default boolean isDedicatedServer() { String getVersionString();
throw new AssertionError();
}
boolean modPresent(String modId);
default String getVersionString() { boolean isDevEnv();
throw new AssertionError();
}
void injectPlatformSpecificHacks();
default boolean modPresent(String modId) { void applyASMTransformers(String mixinClassName, ClassNode targetClass);
throw new AssertionError();
}
MinecraftServer getCurrentServer();
default boolean isDevEnv() { boolean isEarlyLoadingNormally();
throw new AssertionError();
}
boolean isLoadingNormally();
default void injectPlatformSpecificHacks() { Path getGameDirectory();
throw new AssertionError();
}
void sendPacket(ServerPlayer player, Object packet);
default void applyASMTransformers(String mixinClassName, ClassNode targetClass) { Multimap<String, String> getCustomModOptions();
throw new AssertionError();
}
void onServerCommandRegister(Consumer<CommandDispatcher<CommandSourceStack>> handler);
default MinecraftServer getCurrentServer() { 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 boolean isEarlyLoadingNormally() { String getPlatformName();
throw new AssertionError();
}
default boolean isLoadingNormally() {
throw new AssertionError();
}
default Path getGameDirectory() {
throw new AssertionError();
}
default void sendPacket(ServerPlayer player, Object packet) {
throw new AssertionError();
}
default void onServerCommandRegister(Consumer<CommandDispatcher<CommandSourceStack>> handler) {
throw new AssertionError();
}
default Multimap<String, String> getCustomModOptions() {
throw new AssertionError();
}
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();
}
default String getPlatformName() {
throw new AssertionError();
}
} }

View File

@ -4,15 +4,16 @@ import net.minecraft.client.gui.components.DebugScreenOverlay;
import org.embeddedt.modernfix.ModernFixClientFabric; import org.embeddedt.modernfix.ModernFixClientFabric;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.List; import java.util.List;
@Mixin(DebugScreenOverlay.class) @Mixin(DebugScreenOverlay.class)
public class GuiMixin { public class GuiMixin {
@Inject(method = "getGameInformation", at = @At("RETURN")) @ModifyVariable(method = "getSystemInformation", at = @At("STORE"), ordinal = 0, require = 0)
private void addModernFix(CallbackInfoReturnable<List<String>> cir) { private List<String> addModernFix(List<String> list) {
cir.getReturnValue().add(ModernFixClientFabric.commonMod.brandingString); 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.ModernFixClient;
import org.embeddedt.modernfix.screen.ModernFixConfigScreen; import org.embeddedt.modernfix.screen.ModernFixConfigScreen;
import java.util.ArrayList;
import java.util.List;
public class ModernFixClientForge { public class ModernFixClientForge {
private static ModernFixClient commonMod; private static ModernFixClient commonMod;
@ -48,11 +51,27 @@ public class ModernFixClientForge {
} }
} }
private static final List<String> brandingList = new ArrayList<>();
@SubscribeEvent(priority = EventPriority.HIGHEST) @SubscribeEvent(priority = EventPriority.HIGHEST)
public void onRenderOverlay(CustomizeGuiOverlayEvent.DebugText event) { public void onRenderOverlay(CustomizeGuiOverlayEvent.DebugText event) {
if(commonMod.brandingString != null && Minecraft.getInstance().options.renderDebug) { if(commonMod.brandingString != null && Minecraft.getInstance().options.renderDebug) {
event.getLeft().add(""); if(brandingList.size() == 0) {
event.getLeft().add(commonMod.brandingString); 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}} {{#commits}}
{{#ifMatches messageTitle "^(?!Merge).*"}} {{#ifMatches messageTitle "^(?!Merge).*"}}
* [{{{messageTitle}}}](https://github.com/embeddedt/ModernFix/commit/{{hashFull}}) - {{{authorName}}} * [{{{messageTitle}}}](https://github.com/embeddedt/ModernFix/commit/{{hashFull}}) - {{{authorName}}}

View File

@ -1,2 +1,2 @@
#!/bin/bash #!/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]*)?$'