Skip to content

Commit

Permalink
Merge branch 'master' into sb-longer-chat-messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Oct 12, 2023
2 parents 011c95f + 4da2e80 commit 0df2850
Show file tree
Hide file tree
Showing 22 changed files with 258 additions and 52 deletions.
73 changes: 53 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1692122114
//version: 1696265388
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -89,6 +89,23 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
def projectJavaVersion = JavaLanguageVersion.of(8)

boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false
boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false

final String CHECKSTYLE_CONFIG = """
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<!-- Use CHECKSTYLE:OFF and CHECKSTYLE:ON comments to suppress checkstyle lints in a block -->
<module name="SuppressionCommentFilter"/>
<module name="AvoidStarImport">
<!-- Allow static wildcard imports for cases like Opcodes and LWJGL classes, these don't get created accidentally by the IDE -->
<property name="allowStaticMemberImports" value="true"/>
</module>
</module>
</module>
"""

checkPropertyExists("modName")
checkPropertyExists("modId")
Expand Down Expand Up @@ -140,6 +157,17 @@ if (!disableSpotless) {
apply from: Blowdryer.file('spotless.gradle')
}

if (!disableCheckstyle) {
apply plugin: 'checkstyle'
tasks.named("checkstylePatchedMc") { enabled = false }
tasks.named("checkstyleMcLauncher") { enabled = false }
tasks.named("checkstyleIdeVirtualMain") { enabled = false }
tasks.named("checkstyleInjectedTags") { enabled = false }
checkstyle {
config = resources.text.fromString(CHECKSTYLE_CONFIG)
}
}

String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"
Expand Down Expand Up @@ -600,15 +628,10 @@ repositories {
}
maven {
name = "ic2"
url = "https://maven.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/")
content {
includeGroup "net.industrial-craft"
}
}
maven {
name = "ic2-mirror"
url = "https://maven2.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
Expand Down Expand Up @@ -770,23 +793,14 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}

dependencies {
def lwjgl3ifyVersion = '1.4.0'
def asmVersion = '9.4'
def lwjgl3ifyVersion = '1.5.0'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.26')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.7')
}

java17PatchDependencies('net.minecraft:launchwrapper:1.17.2') {transitive = false}
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
}

Expand Down Expand Up @@ -1576,6 +1590,25 @@ def getSecondaryArtifacts() {
return secondaryArtifacts
}

def getURL(String main, String fallback) {
return pingURL(main, 10000) ? main : fallback
}

// credit: https://stackoverflow.com/a/3584332
def pingURL(String url, int timeout) {
url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates.
try {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection()
connection.setConnectTimeout(timeout)
connection.setReadTimeout(timeout)
connection.setRequestMethod("HEAD")
int responseCode = connection.getResponseCode()
return 200 <= responseCode && responseCode <= 399
} catch (IOException ignored) {
return false
}
}

// For easier scripting of things that require variables defined earlier in the buildscript
if (file('addon.late.gradle.kts').exists()) {
apply from: 'addon.late.gradle.kts'
Expand Down
9 changes: 5 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ configurations {
dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.0.13:dev")

transformedMod("com.github.GTNewHorizons:NotEnoughItems:2.4.2-GTNH:dev") // force a more up-to-date NEI version
transformedMod("com.github.GTNewHorizons:NotEnoughItems:2.4.3-GTNH:dev") // force a more up-to-date NEI version
transformedMod("com.github.GTNewHorizons:Baubles:1.0.1.16:dev")
transformedMod("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-254-GTNH")
transformedMod("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-259-GTNH")
transformedMod("com.github.GTNewHorizons:Galacticraft:3.0.73-GTNH:dev")
transformedMod("com.github.GTNewHorizons:GT5-Unofficial:5.09.44.14:dev")
transformedMod("com.github.GTNewHorizons:GT5-Unofficial:5.09.44.30:dev")
transformedMod("com.github.GTNewHorizons:HungerOverhaul:1.0.4-GTNH:dev")
transformedMod("com.github.GTNewHorizons:MrTJPCore:1.1.4:dev") // Do not update, fixed afterwards
transformedMod("com.github.GTNewHorizons:Railcraft:9.15.0:dev") { exclude group: "thaumcraft", module: "Thaumcraft" }
transformedMod("com.github.GTNewHorizons:TinkersConstruct:1.10.3-GTNH:dev")
transformedMod("com.github.GTNewHorizons:TinkersConstruct:1.10.5-GTNH:dev")
transformedMod("curse.maven:biomes-o-plenty-220318:2499612")
transformedMod("curse.maven:cofh-core-69162:2388751")
transformedMod("curse.maven:extra-utilities-225561:2264384")
Expand All @@ -37,6 +37,7 @@ dependencies {
transformedModCompileOnly("curse.maven:immersive-engineering-231951:2299019")
transformedMod("com.github.GTNewHorizons:harvestcraft:1.1.1-GTNH:dev")
transformedModCompileOnly deobf('https://media.forgecdn.net/files/4091/561/LOTRMod+v36.15.jar')
transformedModCompileOnly deobf("https://mediafiles.forgecdn.net/files/2523/840/Better+HUD+by+NukeDuck+%5b1.7.10%5d%5b1.3.5%5d.jar")
// Contains an outdated copy of thaumcraft api that breaks class loading at runtime
transformedModCompileOnly(deobf("https://mediafiles.forgecdn.net/files/2241/397/Pam%27s+Harvest+the+Nether+1.7.10a.jar"))
transformedMod(deobf("https://mediafiles.forgecdn.net/files/2340/786/ProjectE-1.7.10-PE1.10.1.jar"))
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ usesMixins = true
# Adds some debug arguments like verbose output and export
usesMixinDebug = true
# Specify the location of your implementation of IMixinPlugin. Leave it empty otherwise.
mixinPlugin =
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
Expand Down
18 changes: 14 additions & 4 deletions src/main/java/com/mitchej123/hodgepodge/LoadingConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class LoadingConfig {

public boolean changeSprintCategory;
public boolean enlargePotionArray;
public boolean fixBetterHUDArmorDisplay;
public boolean fixBetterHUDHPDisplay;
public int betterHUDHPRenderLimit;
public boolean fixBibliocraftPackets;
public boolean fixBibliocraftPathSanitization;
public boolean fixChatWrappedColors;
Expand Down Expand Up @@ -69,6 +72,7 @@ public class LoadingConfig {
public boolean fixJourneymapKeybinds;
public boolean fixJourneymapJumpyScrolling;
public boolean fixJourneymapFilePath;
public boolean fixNetHandlerLoginServerOfflineMode;
public boolean fixNetHandlerPlayClientHandleSetSlot;
public boolean fixNetherLeavesFaceRendering;
public boolean fixNorthWestBias;
Expand Down Expand Up @@ -123,6 +127,7 @@ public class LoadingConfig {
public boolean removeUpdateChecks;
public boolean speedupAnimations;
public boolean speedupBOPFogHandling;
public boolean speedupGrassBlockRandomTicking;
public boolean speedupChunkCoordinatesHashCode;
public boolean speedupProgressBar;
public boolean speedupVanillaFurnace;
Expand Down Expand Up @@ -234,6 +239,9 @@ public LoadingConfig(File file) {
fixGuiGameOver = config.get(Category.FIXES.toString(), "fixGuiGameOver", true, "Fix Game Over GUI buttons disabled if switching fullscreen").getBoolean();
fixHasteArmSwing = config.get(Category.FIXES.toString(), "fixHasteArmSwing", true, "Fix arm not swinging when having too much haste").getBoolean();
fixTimeCommandWithGC = config.get(Category.FIXES.toString(), "fixTimeCommandWithGC", true, "Fix time commands with GC").getBoolean();
fixBetterHUDArmorDisplay = config.get(Category.FIXES.toString(), "fixBetterHUDArmorDisplay",true, "Fix BetterHUD armor bar rendering breaking with skulls").getBoolean();
fixBetterHUDHPDisplay = config.get(Category.FIXES.toString(), "fixBetterHUDHPDisplay",true, "Fix BetterHUD freezing the game when trying to render high amounts of hp").getBoolean();
betterHUDHPRenderLimit = config.get(Category.FIXES.toString(),"betterHUDHPRenderLimit", 5000, "Maximum hp for BetterHUD to render as hearts").getInt();
fixBibliocraftPackets = config.get(Category.FIXES.toString(), "fixBibliocraftPackets", true, "Fix Bibliocraft packet exploits").getBoolean();
fixBibliocraftPathSanitization = config.get(Category.FIXES.toString(), "fixBibliocraftPathSanitization", true, "Fix Bibliocraft path sanitization").getBoolean();
fixZTonesPackets = config.get(Category.FIXES.toString(), "fixZTonesPackets", true, "Fix ZTones packet exploits").getBoolean();
Expand All @@ -255,6 +263,7 @@ public LoadingConfig(File file) {
fixJourneymapKeybinds = config.get(Category.FIXES.toString(), "fixJourneymapKeybinds", true, "Prevent unbinded keybinds from triggering when pressing certain keys").getBoolean();
fixJourneymapJumpyScrolling = config.get(Category.FIXES.toString(), "fixJourneymapJumpyScrolling", true, "Fix jumpy scrolling in the waypoint manager screen").getBoolean();
fixJourneymapFilePath = config.get(Category.FIXES.toString(), "fixJourneymapFilePath", true, "Prevents journeymap from using illegal character in file paths").getBoolean();
fixNetHandlerLoginServerOfflineMode = config.get(Category.FIXES.toString(), "fixNetHandlerLoginServerOfflineMode", true, "Allows the server to assign the logged in UUID to the same username when online_mode is false").getBoolean();
fixNetHandlerPlayClientHandleSetSlot = config.get(Category.FIXES.toString(), "fixNetHandlerPlayClientHandleSetSlot", true, "Prevents crash if server sends itemStack with index larger than client's container").getBoolean();
fixNetherLeavesFaceRendering = config.get(Category.FIXES.toString(), "fixNetherLeavesFaceRendering", true, "If fancy graphics are enabled, Nether Leaves render sides with other Nether Leaves adjacent too").getBoolean();
fixNorthWestBias = config.get(Category.FIXES.toString(), "fixNorthWestBias", true, "Fix northwest bias on RandomPositionGenerator").getBoolean();
Expand Down Expand Up @@ -315,6 +324,7 @@ public LoadingConfig(File file) {
renderDebugMode = config.get(Category.DEBUG.toString(), "renderDebugMode", 0, "Default GL state debug mode. 0 - off, 1 - reduced, 2 - full").setMinValue(0).setMaxValue(2).getInt();
speedupAnimations = config.get(Category.FIXES.toString(), "speedupAnimations", true, "Drastically speedup animated textures (Basically the same as with optifine animations off but animations are working)").getBoolean();
speedupBOPFogHandling = config.get(Category.SPEEDUPS.toString(), "speedupBOPFogHandling", true, "Speedup biome fog rendering in BiomesOPlenty").getBoolean();
speedupGrassBlockRandomTicking = config.get(Category.SPEEDUPS.toString(), "speedupGrassBlockRandomTicking", true, "Speed up grass block random ticking").getBoolean();
speedupChunkCoordinatesHashCode = config.get(Category.SPEEDUPS.toString(), "speedupChunkCoordinatesHashCode", true, "Speedup ChunkCoordinates hashCode").getBoolean();
speedupProgressBar = config.get(Category.ASM.toString(), "speedupProgressBar", true, "Speedup progressbar").getBoolean();
speedupVanillaFurnace = config.get(Category.SPEEDUPS.toString(), "speedupVanillaFurnace", true, "Speedup Vanilla Furnace recipe lookup").getBoolean();
Expand All @@ -330,14 +340,14 @@ public LoadingConfig(File file) {

// Disable for now as it is not compatible with anything modifying RenderBlocks
pollutionAsm = config.get(Category.ASM.toString(), "pollutionAsm", false, "Enable pollution rendering ASM").getBoolean();

// Pollution :nauseous:
furnacesPollute = config.get(Category.POLLUTION.toString(), "furnacesPollute", true, "Make furnaces Pollute").getBoolean();
rocketsPollute = config.get(Category.POLLUTION.toString(), "rocketsPollute", true, "Make rockets Pollute").getBoolean();
railcraftPollutes = config.get(Category.POLLUTION.toString(), "railcraftPollutes", true, "Make Railcraft Pollute").getBoolean();

disableAidSpawnByXUSpikes = config.get(Category.TWEAKS.toString(), "disableAidSpawnByXUSpikes", true, "Disables the spawn of zombie aid when zombie is killed by Extra Utilities Spikes, since it can spawn them too far.").getBoolean();

furnacePollutionAmount = config.get(Category.POLLUTION.toString(), "furnacePollution", 20, "Furnace pollution per second, min 1!", 1, Integer.MAX_VALUE).getInt();
fireboxPollutionAmount = config.get(Category.POLLUTION.toString(), "fireboxPollution", 15, "Pollution Amount for RC Firebox", 1, Integer.MAX_VALUE).getInt();
rocketPollutionAmount = config.get(Category.POLLUTION.toString(), "rocketPollution", 1000, "Pollution Amount for Rockets", 1, Integer.MAX_VALUE).getInt();
Expand All @@ -346,8 +356,8 @@ public LoadingConfig(File file) {
hobbyistEnginePollutionAmount = config.get(Category.POLLUTION.toString(), "hobbyistEnginePollution", 20, "Pollution Amount for hobbyist steam engine", 1, Integer.MAX_VALUE).getInt();
tunnelBorePollutionAmount = config.get(Category.POLLUTION.toString(), "tunnelBorePollution", 2, "Pollution Amount for tunnel bore", 1, Integer.MAX_VALUE).getInt();
explosionPollutionAmount = config.get(Category.POLLUTION.toString(), "explosionPollution", 33.34, "Explosion pollution").getDouble();


// spotless:on
if (config.hasChanged()) config.save();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
import java.io.StringWriter;

import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.*;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TypeInsnNode;
import org.objectweb.asm.tree.VarInsnNode;
import org.objectweb.asm.util.Printer;
import org.objectweb.asm.util.Textifier;
import org.objectweb.asm.util.TraceMethodVisitor;
Expand Down

This file was deleted.

14 changes: 13 additions & 1 deletion src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public enum Mixins {
FIX_NETHANDLERLOGINSERVER_OFFLINEMODE(
new Builder("Allows the server to assign the logged in UUID to the same username when online_mode is false")
.setPhase(Phase.EARLY).addMixinClasses("minecraft.MixinNetHandlerLoginServer_OfflineMode")
.setSide(Side.SERVER).setApplyIf(() -> true) /* no config option for this */
.setSide(Side.SERVER).setApplyIf(() -> Common.config.fixNetHandlerLoginServerOfflineMode)
.addTargetedMod(TargetedMod.VANILLA)),
FIX_INVENTORY_POTION_EFFECT_NUMERALS(
new Builder("Fix potion effects level not displaying properly above a certain value").setPhase(Phase.EARLY)
Expand Down Expand Up @@ -88,6 +88,9 @@ public enum Mixins {
LONGER_MESSAGES_SERVER(new Builder("Longer Messages").setPhase(Phase.EARLY)
.addMixinClasses("minecraft.MixinC01PacketChatMessage_LongerMessages")
.setApplyIf(() -> Common.config.longerSentMessages).addTargetedMod(TargetedMod.VANILLA).setSide(Side.BOTH)),
SPEEDUP_GRASS_BLOCK_RANDOM_TICKING(new Builder("Speed up grass block random ticking").setPhase(Phase.EARLY)
.addMixinClasses("minecraft.MixinBlockGrass").addTargetedMod(TargetedMod.VANILLA)
.setApplyIf(() -> Common.config.speedupGrassBlockRandomTicking)),
CHUNK_COORDINATES_HASHCODE(new Builder("Optimize Chunk Coordinates Hashcode").setPhase(Phase.EARLY)
.addMixinClasses("minecraft.MixinChunkCoordinates").addTargetedMod(TargetedMod.VANILLA)
.setApplyIf(() -> Common.config.speedupChunkCoordinatesHashCode)),
Expand Down Expand Up @@ -404,6 +407,15 @@ public enum Mixins {
new Builder("Thirsty Tank Container").addMixinClasses("automagy.MixinItemBlockThirstyTank")
.setApplyIf(() -> Common.config.thirstyTankContainer).addTargetedMod(TargetedMod.AUTOMAGY)),

// Better HUD
FIX_BETTERHUD_ARMOR_BAR(new Builder("Fix better HUD armor display breaking with skulls")
.addMixinClasses("betterhud.MixinSkullDurabilityDisplay")
.setApplyIf(() -> Common.config.fixBetterHUDArmorDisplay).addTargetedMod(TargetedMod.BETTERHUD)),

FIX_BETTERHUD_HEARTS_FREEZE(new Builder("Fix better HUD freezing the game when trying to render high amounts of hp")
.addMixinClasses("betterhud.MixinHealthRender").setApplyIf(() -> Common.config.fixBetterHUDHPDisplay)
.addTargetedMod(TargetedMod.BETTERHUD)),

// ProjectE
FIX_FURNACE_ITERATION(new Builder("Speedup Furnaces").addMixinClasses("projecte.MixinObjHandler")
.setApplyIf(() -> Common.config.speedupVanillaFurnace).addTargetedMod(TargetedMod.PROJECTE)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum TargetedMod {
ARCHAICFIX("ArchaicFix", "org.embeddedt.archaicfix.ArchaicCore", "archaicfix"),
AUTOMAGY("Automagy", null, "Automagy"),
BAUBLES("Baubles", null, "Baubles"),
BETTERHUD("Better HUD", null, "hud"),
BIBLIOCRAFT("Bibliocraft", null, "BiblioCraft"),
BOP("BiomesOPlenty", null, "BiomesOPlenty"),
BUKKIT("Bukkit/Thermos", "Bukkit", null),
Expand Down
Loading

0 comments on commit 0df2850

Please sign in to comment.