Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix world leak in Redstone Torch #286

Merged
merged 2 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ dependencies {
transformedMod("com.github.GTNewHorizons:Baubles:1.0.1.16:dev")
// Transitive updates to make runClient17 work
transformedMod("com.github.GTNewHorizons:ForgeMultipart:1.3.4:dev")
transformedMod("com.github.GTNewHorizons:Galacticraft:3.0.74-GTNH:dev")
transformedMod("com.github.GTNewHorizons:GT5-Unofficial:5.09.44.74:dev")
transformedMod("com.github.GTNewHorizons:harvestcraft:1.1.1-GTNH: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.11-GTNH:dev")
transformedMod(deobfCurse("automagy-222153:2285272"))
transformedMod(deobfCurse("bibliocraft-228027:2423369"))
transformedMod("curse.maven:biomes-o-plenty-220318:2499612")
transformedMod("curse.maven:cofh-core-69162:2388751")
transformedMod("curse.maven:extra-utilities-225561:2264384")
transformedMod(deobfCurse("extratic-72728:2299292"))
transformedMod(deobfCurse("journeymap-32274:4500658"))
transformedMod("curse.maven:minechem-368422:2905830")
transformedMod(deobfCurse("projecte-226410:2340786"))
transformedMod("curse.maven:travellers-gear-224440:2262113")
transformedMod(deobfCurse("witchery-69673:2234410"))
transformedMod(deobfCurse("ztones-224369:2223720"))
transformedMod("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
transformedMod("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")

transformedModCompileOnly(deobfCurse("automagy-222153:2285272"))
transformedModCompileOnly("com.github.GTNewHorizons:Galacticraft:3.0.74-GTNH:dev")
transformedModCompileOnly("curse.maven:minechem-368422:2905830")
transformedModCompileOnly(deobfCurse("projecte-226410:2340786"))
transformedModCompileOnly(deobfCurse("better-hud-286066:2523840"))
transformedModCompileOnly("curse.maven:immersive-engineering-231951:2299019")
// Contains an outdated copy of thaumcraft api that breaks class loading at runtime
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/mitchej123/hodgepodge/LoadingConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public class LoadingConfig {
public boolean replaceVoxelMapReflection;
public boolean fixVoxelMapYCoord;
public boolean fixVoxelMapChunkNPE;
public boolean fixRedstoneTorchWorldLeak;

// render debug
public boolean renderDebug;
Expand Down Expand Up @@ -354,6 +355,8 @@ public LoadingConfig(File file) {
replaceVoxelMapReflection = config.get(Category.SPEEDUPS.toString(), "replaceVoxelMapReflection", true, "Replace reflection in VoxelMap to directly access the fields instead.").getBoolean();
fixVoxelMapYCoord = config.get(Category.FIXES.toString(), "fixVoxelMapYCoord", true, "Fix Y coordinate being off by one").getBoolean();
fixVoxelMapChunkNPE = config.get(Category.FIXES.toString(), "fixVoxelMapChunkNPE", true, "Fix some NullPointerExceptions").getBoolean();
fixRedstoneTorchWorldLeak = config.get(Category.FIXES.toString(), "fixRedstoneTorchWorldLeak", true, "Fix redstone torch leaking world").getBoolean();


// Pollution :nauseous:
pollutionBlockRecolor = config.get(Category.POLLUTION_RECOLOR.toString(), "pollutionRecolor", true, "Changes colors of certain blocks based on pollution levels").getBoolean();
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ public enum Mixins {
FIX_WORLD_SERVER_LEAKING_UNLOADED_ENTITIES(new Builder("Fix world server leaking unloaded entities")
.setPhase(Phase.EARLY).setSide(Side.BOTH).addMixinClasses("minecraft.MixinWorldServerUpdateEntities")
.setApplyIf(() -> Common.config.fixWorldServerLeakingUnloadedEntities).addTargetedMod(TargetedMod.VANILLA)),

FIX_REDSTONE_TORCH_WORLD_LEAK(new Builder("Fix world leak in redstone torch").setPhase(Phase.EARLY)
.setSide(Side.BOTH).addMixinClasses("minecraft.MixinBlockRedstoneTorch")
.setApplyIf(() -> Common.config.fixRedstoneTorchWorldLeak).addTargetedMod(TargetedMod.VANILLA)),
FIX_ARROW_WRONG_LIGHTING(new Builder("Fix arrow wrong lighting").setPhase(Phase.EARLY)
.addMixinClasses("minecraft.MixinRendererLivingEntity").setSide(Side.CLIENT)
.setApplyIf(() -> Common.config.fixGlStateBugs).addTargetedMod(TargetedMod.VANILLA)),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mitchej123.hodgepodge.mixins.early.minecraft;

import java.util.Map;
import java.util.WeakHashMap;

import net.minecraft.block.BlockRedstoneTorch;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(value = BlockRedstoneTorch.class, remap = false)
public class MixinBlockRedstoneTorch {

@Shadow
private static Map field_150112_b = new WeakHashMap<>();
}