Skip to content

Commit

Permalink
fix: incompatible with Carpet Org Addition
Browse files Browse the repository at this point in the history
fixes #51
  • Loading branch information
RubixDev committed Dec 15, 2023
1 parent 4da1e58 commit 58688bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/main/java/de/rubixdev/rug/RugSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public String description() {

public static boolean shouldApplyReachDistance() {
return !FabricLoader.getInstance().isModLoaded("reach-entity-attributes")
&& !FabricLoader.getInstance().isModLoaded("pehkui");
&& !FabricLoader.getInstance().isModLoaded("pehkui")
&& !FabricLoader.getInstance().isModLoaded("carpet-org-addition");
}

public static class conditionReachDistance implements Condition {
Expand Down
16 changes: 5 additions & 11 deletions src/main/java/de/rubixdev/rug/mixins/EnderPearlEntityMixin.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
package de.rubixdev.rug.mixins;

import de.rubixdev.rug.RugSettings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.projectile.thrown.EnderPearlEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(EnderPearlEntity.class)
public class EnderPearlEntityMixin {
@Redirect(
@ModifyArg(
method = "onCollision",
at =
@At(
value = "INVOKE",
target =
"Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;F)Z"))
private boolean onOnCollision(Entity entity, DamageSource source, float amount) {
return entity.damage(source, RugSettings.enderPearlDamage);
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;F)Z"))
private float setDamageAmount(float original) {
return RugSettings.enderPearlDamage;
}
}

0 comments on commit 58688bc

Please sign in to comment.