Skip to content

Commit e929260

Browse files
committed
Fixes and a tweak for MrCrayfish's Furniture Mod
1 parent 1febd21 commit e929260

File tree

7 files changed

+130
-21
lines changed

7 files changed

+130
-21
lines changed

dependencies.gradle

+12-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ def deobfCurse(String mavenDep) {
99
}
1010

1111
dependencies {
12-
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
12+
runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.1.16:dev")
1313

14-
compile deobfCurse("witchery-69673:2234410")
15-
compile deobfCurse("ganys-surface-222303:2284819")
16-
compile deobfCurse("gilded-games-util-228114:2273362")
17-
compile deobfCurse("aether-ii-223796:2273367")
18-
compile deobfCurse("pams-temperate-plants-221916:2206430")
19-
compile deobfCurse("village-names-259230:4328516")
20-
compile deobfCurse("llibrary-243298:2319767")
14+
implementation("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
15+
implementation deobfCurse("witchery-69673:2234410")
16+
implementation deobfCurse("village-names-259230:4328516")
17+
18+
compileOnly deobfCurse("gilded-games-util-228114:2273362")
19+
compileOnly deobfCurse("aether-ii-223796:2273367")
20+
21+
compileOnly deobfCurse("ganys-surface-222303:2284819")
22+
compileOnly deobfCurse("pams-temperate-plants-221916:2206430")
23+
compileOnly deobfCurse("llibrary-243298:2319767")
24+
compileOnly deobfCurse("mrcrayfish-furniture-mod-55438:2221679")
2125
}

src/main/java/jss/bugtorch/config/BugTorchConfig.java

+4
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public class BugTorchConfig {
101101
public static float scaledWitherDamageMaxHealthMult;
102102

103103
//Mixin mod bugfixes
104+
public static boolean fixCrayfishFurnitureNullPointerException;
104105
public static boolean fixGanysSurfaceOpenTrapdoorBackTexture;
105106
public static boolean fixThaumcraftCandleColorArrayOutOfBounds;
106107
public static boolean fixWitcheryGarlicGarlandBlockBounds;
@@ -109,6 +110,7 @@ public class BugTorchConfig {
109110
public static boolean reuseAetherIIRenderPlayer;
110111

111112
//Mixin mod tweaks
113+
public static boolean disableCrayfishFurnitureAchievements;
112114
public static boolean proxyLLibraryPastebin;
113115

114116
//Category names
@@ -270,6 +272,7 @@ public static void loadModdedMixinConfig(File configFile) {
270272
Configuration config = new Configuration(configFile);
271273

272274
//Bugfixes
275+
fixCrayfishFurnitureNullPointerException = config.getBoolean("fixCrayfishFurnitureNullPointerExceptions", categoryBugfixes, true, "Makes several TEs from MrCrayfish's Furniture Mod implement ISidedInventory correctly.");
273276
fixGanysSurfaceOpenTrapdoorBackTexture = config.getBoolean("fixGanysSurfaceOpenTrapdoorBackTexture", categoryBugfixes, true, "Makes Gany's Surface trapdoors use the correct back texture when open.");
274277
fixThaumcraftCandleColorArrayOutOfBounds = config.getBoolean("fixThaumcraftCandleColorArrayOutOfBounds", categoryBugfixes, true, "Makes Thaumcraft candles not cause an array out of bounds exception if rendered with metadata greater than 15.");
275278
fixWitcheryGarlicGarlandBlockBounds = config.getBoolean("fixWitcheryGarlicGarlandBlockBounds", categoryBugfixes, true, "Makes Witchery Garlic Garlands use correct block bounds on every rotation.");
@@ -278,6 +281,7 @@ public static void loadModdedMixinConfig(File configFile) {
278281
reuseAetherIIRenderPlayer = config.getBoolean("reuseAetherIIRenderPlayer", categoryPerformance, true, "Makes Aether II reuse the same player renderer object across frames.");
279282

280283
//Tweaks
284+
disableCrayfishFurnitureAchievements= config.getBoolean("disableCrayfishFurnitureAchievements", categoryTweaks, false, "Disables MrCrayfish's Furniture Mod achievements.");
281285
proxyLLibraryPastebin = config.getBoolean("proxyLLibraryPastebin", categoryTweaks, false, "Use a pastebin proxy to keep LLibrary from crashing with some regional blocks.");
282286

283287
//Update old config options

src/main/java/jss/bugtorch/mixinplugin/BugTorchLateMixins.java

+25-13
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,28 @@ public String getMixinConfig() {
2121
@Override
2222
public List<String> getMixins(Set<String> loadedMods) {
2323

24-
if(!loadedMods.contains("ganyssurface")) {
24+
if (!loadedMods.contains("cfm")) {
25+
BugTorchConfig.fixCrayfishFurnitureNullPointerException = false;
26+
BugTorchConfig.disableCrayfishFurnitureAchievements = false;
27+
}
28+
if (!loadedMods.contains("ganyssurface")) {
2529
BugTorchConfig.fixGanysSurfaceOpenTrapdoorBackTexture = false;
2630
}
27-
if(!loadedMods.contains("llibrary")) {
31+
if (!loadedMods.contains("llibrary")) {
2832
BugTorchConfig.proxyLLibraryPastebin = false;
2933
}
30-
if(!loadedMods.contains("Thaumcraft")) {
34+
if (!loadedMods.contains("Thaumcraft")) {
3135
BugTorchConfig.fixThaumcraftCandleColorArrayOutOfBounds = false;
3236
}
33-
if(!loadedMods.contains("witchery")) {
37+
if (!loadedMods.contains("witchery")) {
3438
BugTorchConfig.fixWitcheryGarlicGarlandBlockBounds = false;
3539
BugTorchConfig.fixWitcheryLeavesOptifineRendering = false;
3640
BugTorchConfig.fixWitcheryLeavesShearDupe = false;
3741
}
38-
if(!loadedMods.contains("aether")) {
42+
if (!loadedMods.contains("aether")) {
3943
BugTorchConfig.reuseAetherIIRenderPlayer = false;
4044
}
41-
if(loadedMods.contains("notfine")) {
45+
if (loadedMods.contains("notfine")) {
4246
BugTorchConfig.fixWitcheryLeavesOptifineRendering = false;
4347
}
4448

@@ -47,29 +51,37 @@ public List<String> getMixins(Set<String> loadedMods) {
4751
List<String> mixins = new ArrayList<>();
4852

4953
//Mod bugfixes
50-
if(client && BugTorchConfig.fixGanysSurfaceOpenTrapdoorBackTexture) {
54+
if (BugTorchConfig.fixCrayfishFurnitureNullPointerException) {
55+
mixins.add("crayfishfurniture.fix.MixinTileEntityDishwasher");
56+
mixins.add("crayfishfurniture.fix.MixinTileEntityMicrowave");
57+
mixins.add("crayfishfurniture.fix.MixinTileEntityWashingMachine");
58+
}
59+
if (client && BugTorchConfig.fixGanysSurfaceOpenTrapdoorBackTexture) {
5160
mixins.add("ganyssurface.rendering.MixinBlockWoodTrapdoor");
5261
}
53-
if(BugTorchConfig.fixThaumcraftCandleColorArrayOutOfBounds) {
54-
if(client) {
62+
if (BugTorchConfig.fixThaumcraftCandleColorArrayOutOfBounds) {
63+
if (client) {
5564
mixins.add("thaumcraft.sanitizearrayaccess.MixinBlockCandleRenderer");
5665
}
5766
mixins.add("thaumcraft.sanitizearrayaccess.MixinBlockCandle");
5867
}
59-
if(BugTorchConfig.fixWitcheryGarlicGarlandBlockBounds) {
68+
if (BugTorchConfig.fixWitcheryGarlicGarlandBlockBounds) {
6069
mixins.add("witchery.fix.MixinBlockGarlicGarland");
6170
}
62-
if(client && BugTorchConfig.fixWitcheryLeavesOptifineRendering) {
71+
if (client && BugTorchConfig.fixWitcheryLeavesOptifineRendering) {
6372
mixins.add("witchery.rendering.MixinBlockWitchLeaves");
6473
}
65-
if(BugTorchConfig.fixWitcheryLeavesShearDupe) {
74+
if (BugTorchConfig.fixWitcheryLeavesShearDupe) {
6675
mixins.add("witchery.shearing.MixinBlockWitchLeaves");
6776
}
68-
if(client && BugTorchConfig.reuseAetherIIRenderPlayer) {
77+
if (client && BugTorchConfig.reuseAetherIIRenderPlayer) {
6978
mixins.add("aetherii.optimization.MixinClientEventHandler");
7079
}
7180

7281
//Mod tweaks
82+
if(BugTorchConfig.disableCrayfishFurnitureAchievements) {
83+
mixins.add("crayfishfurniture.tweak.MixinFurnitureAchievements");
84+
}
7385
if(BugTorchConfig.proxyLLibraryPastebin) {
7486
mixins.add("llibrary.fix.MixinWebUtils");
7587
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package jss.bugtorch.mixins.late.crayfishfurniture.fix;
2+
3+
import com.mrcrayfish.furniture.tileentity.TileEntityDishwasher;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.Overwrite;
6+
7+
@Mixin(value = TileEntityDishwasher.class)
8+
public abstract class MixinTileEntityDishwasher {
9+
10+
/**
11+
* @author jss2a98aj
12+
* @reason Stop crashing vanilla and modded content that looks for ISidedInventory.
13+
*/
14+
@Overwrite
15+
public int[] getAccessibleSlotsFromSide(int side) {
16+
return new int[]{};
17+
}
18+
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package jss.bugtorch.mixins.late.crayfishfurniture.fix;
2+
3+
import com.mrcrayfish.furniture.tileentity.TileEntityMicrowave;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.Overwrite;
6+
7+
@Mixin(value = TileEntityMicrowave.class)
8+
public abstract class MixinTileEntityMicrowave {
9+
10+
/**
11+
* @author jss2a98aj
12+
* @reason Stop crashing vanilla and modded content that looks for ISidedInventory.
13+
*/
14+
@Overwrite
15+
public int[] getAccessibleSlotsFromSide(int side) {
16+
return new int[]{};
17+
}
18+
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package jss.bugtorch.mixins.late.crayfishfurniture.fix;
2+
3+
import com.mrcrayfish.furniture.tileentity.TileEntityWashingMachine;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.Overwrite;
6+
7+
@Mixin(value = TileEntityWashingMachine.class)
8+
public abstract class MixinTileEntityWashingMachine {
9+
10+
/**
11+
* @author jss2a98aj
12+
* @reason Stop crashing vanilla and modded content that looks for ISidedInventory.
13+
*/
14+
@Overwrite
15+
public int[] getAccessibleSlotsFromSide(int side) {
16+
return new int[]{};
17+
}
18+
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package jss.bugtorch.mixins.late.crayfishfurniture.tweak;
2+
3+
import com.mrcrayfish.furniture.FurnitureAchievements;
4+
import net.minecraft.entity.player.EntityPlayer;
5+
import org.spongepowered.asm.mixin.Mixin;
6+
import org.spongepowered.asm.mixin.Overwrite;
7+
8+
@Mixin(value = FurnitureAchievements.class)
9+
public abstract class MixinFurnitureAchievements {
10+
11+
/**
12+
* @author jss2a98aj
13+
* @reason Disables achievements.
14+
*/
15+
@Overwrite(remap = false)
16+
public static void loadAchievements() {}
17+
18+
/**
19+
* @author jss2a98aj
20+
* @reason Disables achievements.
21+
*/
22+
@Overwrite(remap = false)
23+
public static void registerPage() {}
24+
25+
/**
26+
* @author jss2a98aj
27+
* @reason Disables achievements.
28+
*/
29+
@Overwrite(remap = false)
30+
public static void triggerAchievement(EntityPlayer player, String name) {}
31+
32+
}

0 commit comments

Comments
 (0)