-
-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tectonic Girdle nullifies explosion knockback
(closes #4581)
- Loading branch information
1 parent
08ff8dd
commit 9190ce5
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
Xplat/src/main/java/vazkii/botania/mixin/ProtectionEnchantmentMixin.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 vazkii.botania.mixin; | ||
|
||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.item.enchantment.ProtectionEnchantment; | ||
|
||
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.CallbackInfoReturnable; | ||
|
||
import vazkii.botania.common.item.equipment.bauble.TectonicGirdleItem; | ||
|
||
@Mixin(ProtectionEnchantment.class) | ||
public class ProtectionEnchantmentMixin { | ||
@Inject(method = "getExplosionKnockbackAfterDampener", at = @At("HEAD"), cancellable = true) | ||
private static void cancelExplosionKnockback(LivingEntity living, double knockback, CallbackInfoReturnable<Double> cir) { | ||
if (TectonicGirdleItem.negateExplosionKnockback(living)) { | ||
cir.setReturnValue(0.0); | ||
} | ||
} | ||
} |
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