Skip to content

Commit

Permalink
MiddleClick Module, Notification update.
Browse files Browse the repository at this point in the history
  • Loading branch information
itscola committed Aug 28, 2022
1 parent 74a71be commit 23dd464
Show file tree
Hide file tree
Showing 16 changed files with 315 additions and 60 deletions.
8 changes: 7 additions & 1 deletion src/main/java/top/whitecola/promodule/ProModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import top.whitecola.promodule.modules.ModuleManager;
import top.whitecola.promodule.modules.impls.combat.*;
import top.whitecola.promodule.modules.impls.movement.Eagle;
import top.whitecola.promodule.modules.impls.movement.EagleJump;
import top.whitecola.promodule.modules.impls.movement.LegitSafeWalk;
import top.whitecola.promodule.modules.impls.movement.WTap;
import top.whitecola.promodule.modules.impls.other.*;
import top.whitecola.promodule.modules.impls.render.*;
Expand Down Expand Up @@ -100,6 +102,10 @@ public void registerModules(){
//movement
getModuleManager().addModule(new Eagle());
getModuleManager().addModule(new WTap());
// getModuleManager().addModule(new EagleJump());

// getModuleManager().addModule(new LegitSafeWalk());


//world
getModuleManager().addModule(new FastPlace());
Expand All @@ -109,7 +115,7 @@ public void registerModules(){
getModuleManager().addModule(new GUIBlur());
getModuleManager().addModule(new Notification());
// getModuleManager().addModule(new Hud());
// getModuleManager().addModule(new MiddleClick());
getModuleManager().addModule(new MiddleClick());


}
Expand Down
53 changes: 53 additions & 0 deletions src/main/java/top/whitecola/promodule/common/Position.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package top.whitecola.promodule.common;

public class Position {
public float x;
public float y;
public float x2;
public float y2;

public Position(){}

public Position(float x,float y,float x2,float y2){
this.x = x;
this.y = y;
this.x2 = x2;
this.y2 = y2;
}

public float getX() {
return x;
}

public Position setX(float x) {
this.x = x;
return this;
}

public float getY() {
return y;
}

public Position setY(float y) {
this.y = y;
return this;
}

public float getX2() {
return x2;
}

public Position setX2(float x2) {
this.x2 = x2;
return this;
}

public float getY2() {
return y2;
}

public Position setY2(float y2) {
this.y2 = y2;
return this;
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
package top.whitecola.promodule.gui.notification;


import top.whitecola.promodule.common.Position;

public abstract class AbstractNotification implements INotificationPos, INotificationStyle, INotificationControl {
protected float x;
protected float y;
protected float x2;
protected float y2;
protected Position pos;
protected Position toPos;


protected boolean isFinish;
protected boolean needLeave;
protected boolean Entered;

protected int level;

protected long lastTime;



// @Override
Expand Down Expand Up @@ -37,47 +44,42 @@ public boolean getFinish() {
return false;
}



@Override
public void setX(float x) {
this.x = x;
public int getLevel() {
return level;
}

@Override
public void setY(float y) {
this.y = y;
public void setLevel(int level) {
this.level = level;
}

@Override
public void setX2(float x2) {
this.x2 = x2;
}

@Override
public void setY2(float y2) {
this.y2 = y2;
public Position getPos() {
return pos;
}

@Override
public float getY2() {
return y2;
public Position getToPos() {
return toPos;
}

@Override
public float getX2() {
return x2;
public void setPos(Position pos) {
this.pos = pos;
}

@Override
public float getX() {
return x;
public void setToPos(Position toPos) {
this.toPos = toPos;
}

@Override
public float getY() {
return y;
public boolean isEntered() {
return Entered;
}


public void setEntered(boolean entered) {
Entered = entered;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ public interface INotificationControl {
void setNeedLeave(boolean needLeave);
boolean getNeedLeave();

void setLevel(int isFinish);
int getLevel();

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package top.whitecola.promodule.gui.notification;

import top.whitecola.promodule.common.Position;

public interface INotificationPos {
void setX(float x);
void setY(float y);
float getX();
float getY();

void setX2(float x);
void setY2(float y);
float getX2();
float getY2();
Position getPos();
void setPos(Position pos);

Position getToPos();
void setToPos(Position pos);

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package top.whitecola.promodule.gui.notification;

import top.whitecola.promodule.gui.notification.beans.NotificationRenderEvent;

public interface INotificationStyle {
void render();
void render(NotificationRenderEvent e);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package top.whitecola.promodule.gui.notification;

import top.whitecola.promodule.gui.notification.beans.NotificationRenderEvent;

import java.util.Iterator;
import java.util.Vector;

Expand All @@ -20,6 +22,8 @@ public void push(AbstractNotification notification) {
notifications.get(i).setNeedLeave(true);
}
}


}

@Override
Expand All @@ -30,7 +34,7 @@ public void renderAll() {
if(notification.getFinish()){
iterator.remove();
}
notification.render();
notification.render(new NotificationRenderEvent(notifications.indexOf(notification),line));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package top.whitecola.promodule.gui.notification.beans;

public class NotificationRenderEvent {
private int level;
private int totalLine;

public NotificationRenderEvent(int level,int totalLine){
this.level = level;
this.totalLine = totalLine;
}

public int getLevel() {
return level;
}

public void setLevel(int level) {
this.level = level;
}

public int getTotalLine() {
return totalLine;
}

public void setTotalLine(int totalLine) {
this.totalLine = totalLine;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
package top.whitecola.promodule.gui.notification.impls;

import top.whitecola.promodule.gui.notification.AbstractNotification;
import top.whitecola.promodule.gui.notification.beans.NotificationRenderEvent;

public class PureNotification extends AbstractNotification {
protected long totalTime = 1000;


public PureNotification(){

}

@Override
public void render() {
public void render(NotificationRenderEvent e) {
manageTime(e.getLevel());
if(!isEntered()){

}
}

public void manageTime(int level){
if(lastTime==0){
if(level==1){
lastTime = System.currentTimeMillis();
}
return;
}

if(System.currentTimeMillis() - this.lastTime>=totalTime){
this.setNeedLeave(true);
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import org.lwjgl.Sys;
import top.whitecola.promodule.ProModule;
import top.whitecola.promodule.annotations.ModuleSetting;
import top.whitecola.promodule.events.impls.event.WorldRenderEvent;
import top.whitecola.promodule.injection.wrappers.IMixinEntity;
import top.whitecola.promodule.modules.AbstractModule;
import top.whitecola.promodule.modules.ModuleCategory;
import top.whitecola.promodule.modules.impls.other.MiddleClick;
import top.whitecola.promodule.utils.AimUtils;
import top.whitecola.promodule.utils.PlayerSPUtils;
import top.whitecola.promodule.utils.ServerUtils;
Expand Down Expand Up @@ -57,6 +59,9 @@ public class AimAssist extends AbstractModule {
@ModuleSetting(name = "CheckTeam",type = "select")
public Boolean checkTeam = true;

@ModuleSetting(name = "CheckFriend",type = "select")
public Boolean checkFriend = true;

public long delta, lastTime;

private EntityLivingBase theTarget;
Expand Down Expand Up @@ -194,9 +199,19 @@ private EntityLivingBase getClosest(float range) {
}

private boolean shouldAttack(EntityLivingBase entity){
// if(AimUtils.getRotationsDelta(entity)[0]>fieldOfView && AimUtils.getRotationsDelta(entity)[1]>fieldOfView){
// return false;
// }

if(checkFriend){
MiddleClick middleClick = (MiddleClick) ProModule.getProModule().getModuleManager().getModuleByName("MiddleClick");
if(middleClick!=null&&middleClick.isEnabled()){
if(middleClick.getFriends().contains(entity)){
return false;
}
}
}

if(AimUtils.getRotationsDelta(entity)[0]>fieldOfView || AimUtils.getRotationsDelta(entity)[1]>fieldOfView){
return false;
}

if(entity.isInvisible()){
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package top.whitecola.promodule.modules.impls.movement;

import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import top.whitecola.promodule.modules.AbstractModule;
import top.whitecola.promodule.modules.ModuleCategory;

public class EagleJump extends AbstractModule {

@Override
public void onTick() {

super.onTick();
}

@Override
public ModuleCategory getModuleType() {
return ModuleCategory.MOVEMENT;
}

@Override
public String getModuleName() {
return "EagleJump";

}

}
Loading

0 comments on commit 23dd464

Please sign in to comment.