-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ignore converted foxes in berry bush harm check
close #1451
- Loading branch information
1 parent
6e5de56
commit 2076ef1
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/java/de/teamlapen/vampirism/mixin/MixinSweetBerryBushBlock.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,25 @@ | ||
package de.teamlapen.vampirism.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import de.teamlapen.vampirism.core.ModEntities; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.SweetBerryBushBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(SweetBerryBushBlock.class) | ||
public class MixinSweetBerryBushBlock { | ||
|
||
@Inject(method = "entityInside", at = @At(value = "HEAD"), cancellable = true) | ||
private void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity pEntity, CallbackInfo ci) { | ||
if (pEntity.getType() == ModEntities.CONVERTED_FOX.get()) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
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