Skip to content

Commit

Permalink
Adjusted OnlyOwn for AC, fixed HUD Potion time
Browse files Browse the repository at this point in the history
  • Loading branch information
IUDevman committed Oct 12, 2020
1 parent 0cebdd3 commit b3e6e83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/gamesense/client/GameSenseMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.awt.Font;

import com.gamesense.api.util.world.TpsUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.opengl.Display;
Expand Down Expand Up @@ -72,8 +73,6 @@ public void init(FMLInitializationEvent event){

fontRenderer = new CFontRenderer(new Font("Ariel", Font.PLAIN, 18), true,true);

//TpsUtils tpsUtils = new TpsUtils();

settingsManager = new SettingsManager();
log.info("Settings initialized!");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,14 @@ private boolean crystalCheck(Entity crystal) {

if (breakMode.getValue().equalsIgnoreCase("Only Own")) {
for (BlockPos pos : new ArrayList<BlockPos>(PlacedCrystals)) {
if (pos != null && pos.getDistance((int)crystal.posX, (int)crystal.posY, (int)crystal.posZ) <= 3)
if (pos != null && pos.getDistance((int)crystal.posX, (int)crystal.posY, (int)crystal.posZ) <= 1) {
return true;
}
}
}

if (breakMode.getValue().equalsIgnoreCase("Smart")) {



EntityLivingBase target = renderEnt != null ? (EntityLivingBase) renderEnt : GetNearTarget(crystal);

if (target == null)
Expand Down
13 changes: 2 additions & 11 deletions src/main/java/com/gamesense/client/module/modules/hud/HUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.gamesense.api.players.friends.Friends;
import com.gamesense.api.settings.Setting;
import com.gamesense.api.util.font.FontUtils;
import com.gamesense.api.util.world.TpsUtils;
import com.gamesense.api.util.render.GSColor;
import com.gamesense.client.GameSenseMod;
import com.gamesense.client.module.Module;
Expand All @@ -22,12 +21,12 @@
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import org.lwjgl.opengl.GL11;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
Expand Down Expand Up @@ -70,8 +69,6 @@ public HUD() {
int sort;
int modCount;
int count;
DecimalFormat format1 = new DecimalFormat("0");
DecimalFormat format2 = new DecimalFormat("00");

private static final RenderItem itemRender = Minecraft.getMinecraft()
.getRenderItem();
Expand Down Expand Up @@ -116,14 +113,8 @@ public void onRender() {
try {
mc.player.getActivePotionEffects().forEach(effect -> {
String name = I18n.format(effect.getPotion().getName());
double duration = effect.getDuration() / TpsUtils.getTickRate();
int amplifier = effect.getAmplifier() + 1;
double p1 = duration % 60;
double p2 = duration / 60;
double p3 = p2 % 60;
String minutes = format1.format(p3);
String seconds = format2.format(p1);
String s = name + " " + amplifier + ChatFormatting.GRAY + " " + minutes + ":" + seconds;
String s = name + " " + amplifier + ChatFormatting.GRAY + " " + Potion.getPotionDurationString(effect, 1.0f);
if (psortUp.getValue()) {
if (pright.getValue()) {
FontUtils.drawStringWithShadow(customFont.getValue(), s, potionx.getValue() - FontUtils.getStringWidth(customFont.getValue(),s),potiony.getValue() + (count * 10), c);
Expand Down

0 comments on commit b3e6e83

Please sign in to comment.