Skip to content

Commit

Permalink
Improvement of crystal aura and added mode Control in strafe,
Browse files Browse the repository at this point in the history
2.5.4
  • Loading branch information
MrsRina committed Apr 25, 2022
1 parent d5cd67a commit 5ed088c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/main/java/rina/onepop/club/Onepop.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public class Onepop {
public static final String PATH_PRESET = PATH_CONFIG + "preset/";
public static final String CHAT = ChatFormatting.GRAY + NAME + " " + ChatFormatting.WHITE;

public static final ModuleAutoCrystalRewrite MODULE_AUTO_CRYSTAL_REWRITE = new ModuleAutoCrystalRewrite();

/*
* We create one final Minecraft, there is the function Minecraft or this variable;
*/
Expand Down Expand Up @@ -148,12 +150,12 @@ public void onRegistry() {
this.moduleManager.registry(new ModuleGeneral());

// Category Combat.
this.moduleManager.registry(MODULE_AUTO_CRYSTAL_REWRITE);
this.moduleManager.registry(new ModuleAutoTrap());
this.moduleManager.registry(new ModuleBowBomb());
this.moduleManager.registry(new ModuleAutoCityMine());
this.moduleManager.registry(new ModuleObsidianPlace());
this.moduleManager.registry(new ModuleBurrow());
this.moduleManager.registry(new ModuleAutoCrystalRewrite());
this.moduleManager.registry(new ModuleOffhand());
this.moduleManager.registry(new ModuleFastBow());
this.moduleManager.registry(new ModuleAutoMinecartBomb());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

import java.awt.*;

import static rina.onepop.club.Onepop.MODULE_AUTO_CRYSTAL_REWRITE;

/**
* @author SrRina
* @since 15/11/20 at 7:45pm
Expand Down Expand Up @@ -77,6 +79,10 @@ public void onTick(TickEvent.ClientTickEvent event) {
return;
}

if (MODULE_AUTO_CRYSTAL_REWRITE.isEnabled()) {
MODULE_AUTO_CRYSTAL_REWRITE.onDirectTick();
}

Onepop.getPomeloEventManager().dispatchEvent(new ClientTickEvent());
Onepop.getSpammerManager().onUpdateAll();
Onepop.getTrackerManager().onUpdateAll();
Expand Down Expand Up @@ -167,6 +173,13 @@ public void onWorldRender(RenderWorldLastEvent event) {
return;
}

this.setCurrentRender3DPartialTicks(event.getPartialTicks());

if (MODULE_AUTO_CRYSTAL_REWRITE.isEnabled()) {
MODULE_AUTO_CRYSTAL_REWRITE.onDirectDraw3D();
}


float[] currentSystemCycle = {
(System.currentTimeMillis() % (360 * 32)) / (360f * 32f)
};
Expand All @@ -179,8 +192,6 @@ public void onWorldRender(RenderWorldLastEvent event) {
(currentColorCycle & 0xFF)
};

this.setCurrentRender3DPartialTicks(event.getPartialTicks());

/*
* Basically the ticks are more smooth in event RenderWorldLastEvent;
* This make any color update as the color fully smooth.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ public void onDisable() {
}
}

@Override
public void onRender3D() {
public void onDirectDraw3D() {
if (this.position != null && settingColorPlace.getValue() && !ModuleAutoCrystalRender.INSTANCE.isEnabled()) {
RenderUtil.drawSolidBlock(camera, this.position, settingColorPlace.getColor());
RenderUtil.drawOutlineBlock(camera, this.position, settingLineSize.getValue().floatValue(), settingColorPlace.getColor(settingLineAlpha.getValue().intValue()));
Expand Down Expand Up @@ -238,9 +237,8 @@ public void onPacketReceive(PacketEvent.Receive event) {
}
}
}

@Listener(priority = ListenerPriority.HIGHEST)
public void onTickEvent(RunTickEvent event) {

public void onDirectTick() {
if (NullUtil.isPlayerWorld()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ public void onReceivePacket(PacketEvent.Receive event) {
this.additionZ = packet.getMotionZ();

this.setRequiredAddition();

if (settingBoost.getValue() == Boost.CONTROL) {
double factorX = this.additionX / 8000.0D;
double factorZ = this.additionZ / 8000.0D;

float f = mc.player.rotationYaw * 0.017453292F;
double x = Math.sqrt(factorX * factorX + factorZ * factorZ);

if (mc.player.isPotionActive(MobEffects.SPEED)) {
int i = mc.player.getActivePotionEffect(MobEffects.SPEED).getAmplifier();

x = x * (1.0 + 0.1 * (i + 1));
}

mc.player.motionX -= MathHelper.sin(f) * x;
mc.player.motionZ += MathHelper.cos(f) * x;

this.unsetRequiredAddition();
}
}
}
}
Expand Down Expand Up @@ -261,7 +280,6 @@ public void onUpdateMovement(PlayerMoveEvent event) {
this.speed = sqrt > theSpeed ? (flag ? sqrt + (settingSpeedLimiter.getValue().doubleValue() / 1000) : sqrt) : theSpeed;

this.applyAirControl(event);
this.unsetRequiredAddition();
}

public void applyAirControl(PlayerMoveEvent event) {
Expand Down Expand Up @@ -305,6 +323,7 @@ public void applyAirControl(PlayerMoveEvent event) {
double mz = this.additionZ / 8000.0D;

this.speed += Math.sqrt(mx * mx + mz * mz);
this.unsetRequiredAddition();
}

switch ((CalculateMode) settingCalculateMode.getValue()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"modid": "onepop",
"name": "Onepop",
"description": "Onepop is an utility combat client paid made by Rina, but now open source & free.",
"version": "2.5",
"version": "2.5.4",
"mcversion": "1.12.2",
"url": "https://github.com/SirRina/onepop",
"updateUrl": "",
Expand Down

0 comments on commit 5ed088c

Please sign in to comment.