-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix cats not dropping gifts after sleeping
- Loading branch information
1 parent
b6a4b76
commit 3707584
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...rc/main/java/io/github/steveplays28/stevesrealisticsleep/mixin/entity/CatEntityMixin.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,17 @@ | ||
package io.github.steveplays28.stevesrealisticsleep.mixin.entity; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(targets = "net/minecraft/entity/passive/CatEntity$SleepWithOwnerGoal") | ||
public class CatEntityMixin { | ||
@Unique | ||
private static final float stevesrealisticsleep$ALLOWED_SKY_ANGLE_FOR_GIFT_DROPS = 0.78f; | ||
|
||
@ModifyExpressionValue(method = "stop", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getSkyAngle(F)F")) | ||
private float stevesrealisticsleep$preventUseOfSkyAngleForGiftDrops(float original) { | ||
return stevesrealisticsleep$ALLOWED_SKY_ANGLE_FOR_GIFT_DROPS; | ||
} | ||
} |
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