Skip to content

Commit

Permalink
- 新增 MrCrayFishFurniture 模组的洗衣机修复。
Browse files Browse the repository at this point in the history
  • Loading branch information
KasumiNova committed Sep 10, 2024
1 parent ddd1546 commit 1a81aad
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {

// Project properties
group = "github.kasuminova.stellarcore"
version = "1.3.4"
version = "1.3.5"

// Set the toolchain version to decouple the Java we run Gradle with from the Java used to compile and run the mod
java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ public static class MrCrayfishFurniture {
@Config.Name("BlockFurnitureTileFixes")
public boolean blockFurnitureTile = true;

@Config.Comment("Stopping washing machines from repairing non-repairable items.")
@Config.Name("WashingMachineDamageFixes")
public boolean washingMachine = true;

}

public static class RPSIdeas {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package github.kasuminova.stellarcore.mixin.cfm;

import com.mrcrayfish.furniture.tileentity.TileEntityWashingMachine;
import github.kasuminova.stellarcore.common.config.StellarCoreConfig;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@SuppressWarnings("MethodMayBeStatic")
@Mixin(TileEntityWashingMachine.class)
public class MixinTileEntityWashingMachine {

@Redirect(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 0))
private boolean redirectUpdateIsEmpty(final ItemStack instance) {
if (!StellarCoreConfig.BUG_FIXES.mrCrayfishFurniture.washingMachine) {
return instance.isEmpty();
}
return instance.isEmpty() || !instance.getItem().isRepairable();
}

}
3 changes: 2 additions & 1 deletion src/main/resources/mixins.stellar_core_cfm.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"MixinTileEntityKitchenCounter",
"MixinTileEntityKitchenCounterDrawer",
"MixinTileEntitySyncClient",
"MixinTileEntityTVStand"
"MixinTileEntityTVStand",
"MixinTileEntityWashingMachine"
],
"client": [
"MixinImageCache"
Expand Down

0 comments on commit 1a81aad

Please sign in to comment.