Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix food properties not setting some values. Close #1483
- Loading branch information
1 parent
eb4585b
commit 0b29b63
Showing
4 changed files
with
64 additions
and
59 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
.../main/java/com/blamejared/crafttweaker/mixin/common/access/food/AccessFoodProperties.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,48 @@ | ||
package com.blamejared.crafttweaker.mixin.common.access.food; | ||
|
||
import com.mojang.datafixers.util.Pair; | ||
import net.minecraft.world.effect.MobEffectInstance; | ||
import net.minecraft.world.food.FoodProperties; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
import org.spongepowered.asm.mixin.gen.Invoker; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(FoodProperties.class) | ||
public interface AccessFoodProperties { | ||
|
||
@Invoker("<init>") | ||
static FoodProperties crafttweaker$createFoodProperties(int nutrition, float saturationModifier, boolean isMeat, boolean canAlwaysEat, boolean fastFood, List<Pair<MobEffectInstance, Float>> effects) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Mutable | ||
@Accessor("nutrition") | ||
void crafttweaker$setNutrition(int nutrition); | ||
|
||
@Mutable | ||
@Accessor("saturationModifier") | ||
void crafttweaker$setSaturationModifier(float saturationModifier); | ||
|
||
@Mutable | ||
@Accessor("isMeat") | ||
void crafttweaker$setIsMeat(boolean isMeat); | ||
|
||
@Mutable | ||
@Accessor("canAlwaysEat") | ||
void crafttweaker$setCanAlwaysEat(boolean canAlwaysEat); | ||
|
||
@Mutable | ||
@Accessor("fastFood") | ||
void crafttweaker$setFastFood(boolean fastFood); | ||
|
||
@Accessor("effects") | ||
List<Pair<MobEffectInstance, Float>> crafttweaker$getEffects(); | ||
|
||
@Mutable | ||
@Accessor("effects") | ||
void crafttweaker$setEffects(List<Pair<MobEffectInstance, Float>> effects); | ||
|
||
} |
26 changes: 0 additions & 26 deletions
26
...ava/com/blamejared/crafttweaker/mixin/common/access/food/AccessFoodPropertiesBuilder.java
This file was deleted.
Oops, something went wrong.
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