Skip to content

Commit 40fb5f8

Browse files
committed
Add Antisocial
1 parent 64f12f1 commit 40fb5f8

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

build/libs/asteroide-0.2.2.jar

133 KB
Binary file not shown.

src/main/java/spigey/asteroide/AsteroideAddon.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public void onInitialize() {
132132
modules.add(new AntiAntiXrayModule());
133133
modules.add(new AntiAimModule());
134134
modules.add(new AutoShieldModule());
135+
modules.add(new AntiSocialModule());
135136

136137
// Commands
137138
Commands.add(new CrashAll());
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package spigey.asteroide.modules;
2+
3+
import meteordevelopment.meteorclient.events.world.CollisionShapeEvent;
4+
import meteordevelopment.meteorclient.settings.EntityTypeListSetting;
5+
import meteordevelopment.meteorclient.settings.IntSetting;
6+
import meteordevelopment.meteorclient.settings.Setting;
7+
import meteordevelopment.meteorclient.settings.SettingGroup;
8+
import meteordevelopment.meteorclient.systems.modules.Module;
9+
import meteordevelopment.orbit.EventHandler;
10+
import net.minecraft.block.Blocks;
11+
import net.minecraft.entity.Entity;
12+
import net.minecraft.entity.EntityType;
13+
import net.minecraft.util.math.Vec3d;
14+
import net.minecraft.util.shape.VoxelShapes;
15+
import spigey.asteroide.AsteroideAddon;
16+
17+
import java.util.Set;
18+
19+
public class AntiSocialModule extends Module {
20+
public AntiSocialModule() { super(AsteroideAddon.CATEGORY, "Antisocial", "Prevents you from going near specified entities."); }
21+
private SettingGroup sgGeneral = settings.getDefaultGroup();
22+
private Setting<Set<EntityType<?>>> entities = sgGeneral.add(new EntityTypeListSetting.Builder()
23+
.name("Entities")
24+
.description("Entities to prevent the player getting close to")
25+
.defaultValue(Set.of(net.minecraft.entity.EntityType.PLAYER))
26+
.build()
27+
);
28+
private Setting<Integer> distance = sgGeneral.add(new IntSetting.Builder()
29+
.name("Distance")
30+
.description("Distance in blocks to block movement in")
31+
.defaultValue(5)
32+
.build()
33+
);
34+
35+
@EventHandler
36+
private void onCollisionShape(CollisionShapeEvent event) {
37+
for(Entity entity : mc.world.getEntities()){
38+
if(!entities.get().contains(entity.getType())) continue;
39+
if(mc.player == entity) continue;
40+
if(entity.squaredDistanceTo(Vec3d.ofCenter(event.pos)) > distance.get() * distance.get()) continue;
41+
event.shape = VoxelShapes.fullCube();
42+
//mc.world.setBlockState(event.pos, Blocks.RED_STAINED_GLASS.getDefaultState());
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)