diff --git a/src/main/java/spigey/asteroide/mixin/WorldBorderMixin.java b/src/main/java/spigey/asteroide/mixin/WorldBorderMixin.java index 9b06b16..0d25317 100644 --- a/src/main/java/spigey/asteroide/mixin/WorldBorderMixin.java +++ b/src/main/java/spigey/asteroide/mixin/WorldBorderMixin.java @@ -1,20 +1,21 @@ package spigey.asteroide.mixin; -import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Modules; -import meteordevelopment.meteorclient.systems.modules.misc.AutoRespawn; import net.minecraft.entity.Entity; -import net.minecraft.network.NetworkState; import net.minecraft.util.math.Box; -import net.minecraft.util.math.MathHelper; import net.minecraft.world.border.WorldBorder; import org.spongepowered.asm.mixin.*; import spigey.asteroide.modules.BorderNoclipModule; +import static meteordevelopment.meteorclient.MeteorClient.mc; + @Mixin(WorldBorder.class) public abstract class WorldBorderMixin { + @Shadow + private double damagePerBlock; + /** * @author * @reason @@ -23,4 +24,16 @@ public abstract class WorldBorderMixin { public boolean canCollide(Entity entity, Box box) { return !Modules.get().get(BorderNoclipModule.class).isActive(); } + /** + * @author + * @reason + */ + @Overwrite + public double getDamagePerBlock(){ + if(!Modules.get().get(BorderNoclipModule.class).isActive()) { + assert mc.world != null; + return mc.world.getWorldBorder().getDamagePerBlock(); + } + return Modules.get().get(BorderNoclipModule.class).damage.get(); + } } diff --git a/src/main/java/spigey/asteroide/modules/BorderNoclipModule.java b/src/main/java/spigey/asteroide/modules/BorderNoclipModule.java index 060fba4..8d6a769 100644 --- a/src/main/java/spigey/asteroide/modules/BorderNoclipModule.java +++ b/src/main/java/spigey/asteroide/modules/BorderNoclipModule.java @@ -1,6 +1,10 @@ package spigey.asteroide.modules; import meteordevelopment.meteorclient.events.world.TickEvent; +import meteordevelopment.meteorclient.settings.DoubleSetting; +import meteordevelopment.meteorclient.settings.IntSetting; +import meteordevelopment.meteorclient.settings.Setting; +import meteordevelopment.meteorclient.settings.SettingGroup; import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.orbit.EventHandler; import net.minecraft.entity.Entity; @@ -12,6 +16,15 @@ public class BorderNoclipModule extends Module { public BorderNoclipModule() { super(AsteroideAddon.CATEGORY, "border-noclip", "Removes the world border collision"); } + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + public final Setting damage = sgGeneral.add(new DoubleSetting.Builder() + .name("damage-per-block") + .description("Damage dealt per block when outside the world border") + .defaultValue(0) + .min(0) + .sliderMax(10) + .build() + ); }