-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #432 from WaitingIdly/direct-crash
make Extra Utilities 2 Machine Block drops mutable
- Loading branch information
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ng/universaltweaks/mods/extrautilities/mutabledrops/mixin/UTMutableBlockMachineDrops.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package mod.acgaming.universaltweaks.mods.extrautilities.mutabledrops.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyReturnValue; | ||
import com.rwtema.extrautils2.machine.BlockMachine; | ||
import mod.acgaming.universaltweaks.config.UTConfigMods; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
// Courtesy of WaitingIdly | ||
@Mixin(value = BlockMachine.class, remap = false) | ||
public abstract class UTMutableBlockMachineDrops | ||
{ | ||
@ModifyReturnValue(method = "getDrops", at = @At(value = "RETURN")) | ||
private List<ItemStack> utEnforceMutableDrops(List<ItemStack> original) | ||
{ | ||
if (!UTConfigMods.EXTRA_UTILITIES.utMutableBlockDrops) return original; | ||
return new ArrayList<>(original); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/mixins.mods.extrautilities.mutabledrops.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.mods.extrautilities.mutabledrops.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTMutableBlockMachineDrops"] | ||
} |