-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eaf67fc
commit a0045b2
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/de/dafuqs/spectrum/mixin/FallingBlockEntityMixin.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,21 @@ | ||
package de.dafuqs.spectrum.mixin; | ||
|
||
import java.util.function.Predicate; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.FallingBlockEntity; | ||
import net.minecraft.entity.ItemEntity; | ||
|
||
@Mixin(FallingBlockEntity.class) | ||
public class FallingBlockEntityMixin { | ||
|
||
@ModifyVariable(method = "handleFallDamage(FFLnet/minecraft/entity/damage/DamageSource;)Z", at = @At(value = "STORE"), ordinal = 0, index = 1, name = "predicate") | ||
public Predicate<Entity> addItemEntityPredicate(Predicate<Entity> predicate) { | ||
return predicate.or(entity -> entity instanceof ItemEntity); | ||
} | ||
|
||
} |
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