Skip to content

Commit

Permalink
fix extra utilities ender quarry freeze randomly
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilzinsel64 committed Jan 23, 2025
1 parent 7449cf9 commit 495ee29
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ public class FixesConfig {
@Config.DefaultBoolean(true)
public static boolean fixExtraUtilitiesFilterDupe;

@Config.Comment("Fixes Ender Quarry get stuck at a mostly random location under certain conditions")
@Config.DefaultBoolean(true)
public static boolean fixExtraUtilitiesEnderQuarryFreeze;

// Galacticraft

@Config.Comment("Fix time commands with GC")
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 @@ -846,6 +846,10 @@ public enum Mixins {
.addMixinClasses("extrautilities.MixinTileEntityEnderQuarry").setPhase(Phase.LATE).setSide(Side.BOTH)
.setApplyIf(() -> TweaksConfig.extraUtilitiesEnderQuarryOverride > 0)
.addTargetedMod(TargetedMod.EXTRA_UTILITIES)),
FIX_ENDERQUARRY_FREEZE(new Builder("Fix Ender Quarry freezes randomly")
.addMixinClasses("extrautilities.MixinTileEntityEnderQuarry_FixFreeze").setPhase(Phase.LATE)
.setSide(Side.BOTH).setApplyIf(() -> FixesConfig.fixExtraUtilitiesEnderQuarryFreeze)
.addTargetedMod(TargetedMod.EXTRA_UTILITIES)),

// Gliby's Voice Chat
FIX_GLIBYS_VC_THREAD_SHUTDOWN_CLIENT(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.mitchej123.hodgepodge.mixins.late.extrautilities;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry;

@Mixin(TileEntityEnderQuarry.class)
public class MixinTileEntityEnderQuarry_FixFreeze {

@ModifyReturnValue(method = "harvestBlock", at = @At("RETURN"), remap = false)
private boolean hodgepodge$fixFreeze(boolean original) {
// To fix a weird issue with certain mods that let the Ender Quarry stuck at a
// mostly random location, return true also in the following (all) scenario:
// - The harvested block has no drops
// - The harvested block has unexpected drops
// - The harvested block has been harvested by another Entity
return true;
}
}

0 comments on commit 495ee29

Please sign in to comment.