Crystal optimizer & sprint patch
This commit is contained in:
parent
688c2735ea
commit
de513f4329
58177
javascript/classes.js
58177
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,14 +1,15 @@
|
|||
package dev.resent.module.impl.hud;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import dev.resent.module.Theme;
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.RenderModule;
|
||||
import dev.resent.module.setting.BooleanSetting;
|
||||
import dev.resent.util.misc.FuncUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CPS extends RenderModule {
|
||||
|
||||
public CPS() {
|
||||
|
@ -39,7 +40,7 @@ public class CPS extends RenderModule {
|
|||
final long time = System.currentTimeMillis();
|
||||
FuncUtils.removeIf(clicks, aLong -> aLong + 1000 < time);
|
||||
|
||||
mc.fontRendererObj.drawString("[CPS: " + clicks.size() + "]", this.x+2, this.y+2, -1, tshadow.getValue());
|
||||
mc.fontRendererObj.drawString("[CPS: " + clicks.size() + "]", this.x+2, this.y+2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
package dev.resent.module.impl.movement;
|
||||
|
||||
import dev.resent.module.Theme;
|
||||
import dev.resent.module.base.Category;
|
||||
import dev.resent.module.base.RenderModule;
|
||||
import dev.resent.module.setting.BooleanSetting;
|
||||
import dev.resent.ui.ClickGUI;
|
||||
import dev.resent.ui.HUDConfigScreen;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class Sprint extends RenderModule {
|
||||
|
@ -23,24 +24,30 @@ public class Sprint extends RenderModule {
|
|||
|
||||
private String getText() {
|
||||
String text = "";
|
||||
boolean definitive = false;
|
||||
if (mc.thePlayer.capabilities.isFlying) {
|
||||
text = " [Flying]";
|
||||
}
|
||||
|
||||
if (mc.gameSettings.keyBindSprint.isKeyDown()) {
|
||||
keyHeldTicks += 1;
|
||||
definitive = true;
|
||||
text = "[Sprinting (Key Held)] ";
|
||||
} else if (!mc.gameSettings.keyBindSprint.isKeyDown()) {
|
||||
keyHeldTicks = 0;
|
||||
}
|
||||
|
||||
/*if(keyHeldTicks > 0 && clickDebounce == false) {
|
||||
toggled = !toggled;
|
||||
clickDebounce = true;
|
||||
} else if(clickDebounce == true) {
|
||||
clickDebounce = false;
|
||||
}*/
|
||||
if (keyHeldTicks > 0) {
|
||||
toggled = !toggled;
|
||||
}
|
||||
|
||||
if (toggled) {
|
||||
if (!mc.thePlayer.isUsingItem()) mc.thePlayer.setSprinting(true);
|
||||
text = "[Sprinting (Toggled)]";
|
||||
if (mc.thePlayer.movementInput.moveForward == 1 && !mc.thePlayer.isUsingItem()) mc.thePlayer.setSprinting(true);
|
||||
text = definitive ? text : "[Sprinting (Toggled)]";
|
||||
}
|
||||
|
||||
lastKeyHeldTicks = keyHeldTicks;
|
||||
|
@ -49,14 +56,17 @@ public class Sprint extends RenderModule {
|
|||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
if (mc.currentScreen instanceof HUDConfigScreen || mc.currentScreen instanceof ClickGUI) {
|
||||
return fr.getStringWidth("[Sprinting [Toggled)]");
|
||||
} else {
|
||||
return fr.getStringWidth(getText());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw() {
|
||||
this.fr = mc.fontRendererObj;
|
||||
if (drawn.getValue())
|
||||
fr.drawStringWithShadow(getText(), x + 2, y + 2, Theme.getFontColor(Theme.getId()));
|
||||
if (drawn.getValue()) fr.drawStringWithShadow(getText(), x + 2, y + 2, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -331,7 +331,7 @@ public abstract class Entity {
|
|||
* sets the dead flag. Used when you fall off the bottom of the
|
||||
* world.
|
||||
*/
|
||||
protected void kill() {
|
||||
public void kill() {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
|
|
|
@ -890,7 +890,7 @@ public abstract class EntityLivingBase extends Entity {
|
|||
* sets the dead flag. Used when you fall off the bottom of the
|
||||
* world.
|
||||
*/
|
||||
protected void kill() {
|
||||
public void kill() {
|
||||
this.attackEntityFrom(DamageSource.outOfWorld, 4.0F);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package net.minecraft.entity.player;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.event.impl.Event.EventType;
|
||||
import dev.resent.event.impl.EventAttack;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -14,6 +16,7 @@ import net.minecraft.block.BlockBed;
|
|||
import net.minecraft.block.BlockDirectional;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.server.CommandBlockLogic;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
|
@ -28,6 +31,7 @@ import net.minecraft.entity.SharedMonsterAttributes;
|
|||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.entity.boss.EntityDragonPart;
|
||||
import net.minecraft.entity.item.EntityBoat;
|
||||
import net.minecraft.entity.item.EntityEnderCrystal;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
|
@ -69,7 +73,9 @@ import net.minecraft.util.EnumParticleTypes;
|
|||
import net.minecraft.util.FoodStats;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.world.EnumDifficulty;
|
||||
import net.minecraft.world.IInteractionObject;
|
||||
import net.minecraft.world.LockCode;
|
||||
|
@ -989,6 +995,19 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS
|
|||
event.setType(EventType.pre);
|
||||
Resent.onEvent(event);
|
||||
|
||||
MovingObjectPosition entityHitResult;
|
||||
MovingObjectPosition hitResult = Minecraft.getMinecraft().objectMouseOver;
|
||||
|
||||
if (hitResult == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hitResult.typeOfHit == MovingObjectType.ENTITY && (entity = (entityHitResult = (MovingObjectPosition) hitResult).entityHit) instanceof EntityEnderCrystal) {
|
||||
entity.kill();
|
||||
entity.setDead();
|
||||
entity.onKillEntity((EntityLivingBase)entity);
|
||||
}
|
||||
|
||||
if (entity.canAttackWithItem()) {
|
||||
if (!entity.hitByEntity(this)) {
|
||||
float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
|
||||
|
|
Loading…
Reference in New Issue
Block a user