Skip to content

Commit 2fffd64

Browse files
committed
fix: allow pigs to eat mushrooms
1 parent 89729e1 commit 2fffd64

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dependencies {
6161

6262
// Fix Mods
6363
modImplementation(libs.eiv)
64+
modImplementation(libs.pigs.eat.mushrooms)
6465

6566
// Libraries
6667
modImplementation(libs.fabric.permissions)

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ player-roles = "1.6.13"
1212

1313
# Fixing
1414
eiv = "x5OsJXLC"
15+
pigs-eat-mushrooms = "e4jgavCm"
1516

1617
# Libraries
1718
fabric-permissions = "0.3.3"
@@ -29,6 +30,7 @@ player-roles = { module = "dev.gegy:player-roles", version.ref = "player-roles"
2930

3031
# Fixing
3132
eiv = {module = "maven.modrinth:eiv", version.ref = "eiv"}
33+
pigs-eat-mushrooms = {module = "maven.modrinth:pigs-eat-mushrooms", version.ref = "pigs-eat-mushrooms"}
3234

3335
# Libraries
3436
fabric-permissions = { module = "me.lucko:fabric-permissions-api", version.ref = "fabric-permissions" }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package net.modgarden.flowerbed.mixin.fix.pigs_eat_mushrooms;
2+
3+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
4+
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
5+
import io.github.hasdahlias.EatShroomsGoal;
6+
import net.minecraft.world.level.GameRules;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.Pseudo;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
11+
@Pseudo
12+
@Mixin(EatShroomsGoal.class)
13+
public class Mixin_EatShroomsGoal {
14+
@WrapOperation(
15+
method = "tick",
16+
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/GameRules;getBoolean(Lnet/minecraft/world/level/GameRules$Key;)Z")
17+
)
18+
private boolean flowerbed$allowPigsEatMushrooms(
19+
GameRules instance, GameRules.Key<GameRules.BooleanValue> key, Operation<Boolean> original
20+
) {
21+
return true;
22+
}
23+
}

src/main/resources/flowerbed.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"MIxin_WitherSkullBlock",
1414
"fix.eiv.Mixin_FabricEivResolver",
1515
"fix.log.Mixin_IdDispatchCodec",
16+
"fix.pigs_eat_mushrooms.Mixin_EatShroomsGoal",
1617
"showcase.gamemode.Mixin_ServerPlayer",
1718
"showcase.griefing.Mixin_FarmBlock",
1819
"showcase.griefing.invulnerability.Mixin_ArmorStandItem",

0 commit comments

Comments
 (0)