Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
+ Add Bossbar scaling
+ Rewrite action bar customization
+ Hitbox Customization!
	+ Toggle Hitbox
	+ Toggle Hitbox for items, itemframes, and non-players
	+ Force hitboxes
	+ Disable hitboxes for self
	+ Hitbox, Line Hitbox, and Line of sight hitbox color and toggling
+ Ingame Updater
+ Add Bundle support
+ Make Auto get features much more stable
+ Fix a bug where toggling name highlight would crash the game
+ Move from Pattern class to Regex class
+ Add license statements
+ Update Requisite
+ Update RequisiteLaunchwrapper
+ Update Essential
- Remove pointless debug subcommand
- Remove credits
+ Switch from JsonTGM to GSON
  • Loading branch information
Wyvest committed Aug 12, 2021
1 parent 228d2d0 commit df98814
Show file tree
Hide file tree
Showing 25 changed files with 1,092 additions and 262 deletions.
7 changes: 0 additions & 7 deletions .github/dependabot.yml

This file was deleted.

33 changes: 27 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Wyvtilities - Utilities for Hypixel 1.8.9.
* Copyright (C) 2021 Wyvtilities
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

plugins {
// Languages
id 'java'
Expand All @@ -11,7 +29,7 @@ plugins {
id 'org.spongepowered.mixin' version '0.6-SNAPSHOT'
}

version = '1.0.0'
version = '1.1.0'
group = 'net.wyvest'
archivesBaseName = 'Wyvtilities'

Expand Down Expand Up @@ -48,14 +66,14 @@ configurations {

dependencies {
// Libraries
provided 'xyz.matthewtgm:Requisite:1.0'
include('com.github.Wyvest:RequisiteEssentialLaunchwrapper:9056d99dde') {
provided 'xyz.matthewtgm:Requisite:1.1.1'
include('xyz.matthewtgm:RequisiteLaunchwrapper:1.1') {
transitive = false
}
include('gg.essential:loader-launchwrapper:1.0.2') {
include('gg.essential:loader-launchwrapper:1.1.0') {
transitive = false
}
provided 'gg.essential:essential-1.8.9-forge:1292'
provided 'gg.essential:essential-1.8.9-forge:1300'


annotationProcessor 'org.spongepowered:mixin:0.7.11-SNAPSHOT'
Expand All @@ -81,6 +99,7 @@ processResources {

from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
include 'bundle.project.json'

expand(
'version': project.version,
Expand All @@ -90,6 +109,7 @@ processResources {

from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'bundle.project.json'
}
}

Expand Down Expand Up @@ -123,7 +143,7 @@ shadowJar {

repositories {
mavenCentral()
maven { url 'https://repo.sk1er.club/repository/maven-public/' }
maven { url 'https://repo.sk1er.club/repository/maven-releases/' }
maven { url 'https://jitpack.io/' }
maven { url 'https://repo.spongepowered.org/repository/maven-public/' }
}
Expand All @@ -146,3 +166,4 @@ sourceSets {
output.resourcesDir = file("${buildDir}/classes/kotlin/main")
}
}

18 changes: 18 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Wyvtilities - Utilities for Hypixel 1.8.9.
* Copyright (C) 2021 Wyvtilities
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

pluginManagement {
repositories {
gradlePluginPortal()
Expand Down
23 changes: 19 additions & 4 deletions src/main/java/net/wyvest/wyvtilities/mixin/AccessorGuiIngame.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Wyvtilities - Utilities for Hypixel 1.8.9.
* Copyright (C) 2021 Wyvtilities
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.wyvest.wyvtilities.mixin;

import net.minecraft.client.gui.GuiIngame;
Expand All @@ -10,12 +28,9 @@ public interface AccessorGuiIngame {
@Accessor
String getRecordPlaying();

@Accessor
boolean getRecordIsPlaying();

@Accessor
String getDisplayedTitle();

@Accessor
int getRecordPlayingUpFor();
void setDisplayedTitle(String title);
}
40 changes: 40 additions & 0 deletions src/main/java/net/wyvest/wyvtilities/mixin/MixinGuiIngame.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
/*
* Wyvtilities - Utilities for Hypixel 1.8.9.
* Copyright (C) 2021 Wyvtilities
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.wyvest.wyvtilities.mixin;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.boss.BossStatus;
import net.wyvest.wyvtilities.config.WyvtilsConfig;
import net.wyvest.wyvtilities.gui.BossHealthGui;
Expand All @@ -18,13 +37,24 @@
@Mixin(GuiIngame.class)
public class MixinGuiIngame {

private boolean shouldScale = false;

@Inject(method = "renderBossHealth", at = @At("HEAD"), cancellable = true)
protected void renderBossHealth(CallbackInfo ci) {
if (Minecraft.getMinecraft().currentScreen instanceof BossHealthGui) {
ci.cancel();
return;
}
if (WyvtilsConfig.INSTANCE.getBossBarCustomization() && !WyvtilsConfig.INSTANCE.getBossBar()) ci.cancel();

if (!shouldScale) shouldScale = true;
if (WyvtilsConfig.INSTANCE.getBossBarCustomization()) GlStateManager.pushMatrix();
}

@Inject(method = "renderBossHealth", at = @At("TAIL"), cancellable = true)
protected void tail(CallbackInfo ci) {
if (shouldScale) shouldScale = false;
if (WyvtilsConfig.INSTANCE.getBossBarCustomization()) GlStateManager.popMatrix();
}

@Redirect(method = "renderBossHealth", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I"))
Expand All @@ -45,6 +75,16 @@ private int injected(FontRenderer fontRenderer, String text, float x, float y, i
}
}

@Inject(method = "renderBossHealth", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiIngame;drawTexturedModalRect(IIIIII)V"))
private void applyScale(CallbackInfo ci) {
if (WyvtilsConfig.INSTANCE.getBossBarCustomization() && shouldScale) {
if (WyvtilsConfig.INSTANCE.getBossBarBar() || WyvtilsConfig.INSTANCE.getBossBarText()) {
GlStateManager.scale(WyvtilsConfig.INSTANCE.getBossbarScale(), WyvtilsConfig.INSTANCE.getBossbarScale(), 0F);
shouldScale = false;
}
}
}

@Redirect(method = "renderBossHealth", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiIngame;drawTexturedModalRect(IIIIII)V"))
private void removeBar(GuiIngame guiIngame, int x, int y, int textureX, int textureY, int width, int height) {
if (WyvtilsConfig.INSTANCE.getBossBarCustomization()) {
Expand Down
91 changes: 52 additions & 39 deletions src/main/java/net/wyvest/wyvtilities/mixin/MixinGuiIngameForge.java
Original file line number Diff line number Diff line change
@@ -1,61 +1,74 @@
/*
* Wyvtilities - Utilities for Hypixel 1.8.9.
* Copyright (C) 2021 Wyvtilities
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.wyvest.wyvtilities.mixin;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraftforge.client.GuiIngameForge;
import net.wyvest.wyvtilities.config.WyvtilsConfig;
import net.wyvest.wyvtilities.gui.ActionBarGui;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.awt.*;

@SuppressWarnings("DefaultAnnotationParam")
@Mixin(value = GuiIngameForge.class, remap = false)
public class MixinGuiIngameForge {

Minecraft mc = Minecraft.getMinecraft();

@Inject(method = "renderRecordOverlay", at = @At(value = "HEAD"), cancellable = true)
public void renderActionBar(int width, int height, float partialTicks, CallbackInfo ci) {
if (WyvtilsConfig.INSTANCE.getActionBarCustomization()) {
@Inject(method = "renderRecordOverlay", at = @At("HEAD"), cancellable = true)
private void removeActionBar(int width, int height, float partialTicks, CallbackInfo ci) {
if ((WyvtilsConfig.INSTANCE.getActionBarCustomization() && !WyvtilsConfig.INSTANCE.getActionBar()) || Minecraft.getMinecraft().currentScreen instanceof ActionBarGui) {
ci.cancel();
if (!WyvtilsConfig.INSTANCE.getActionBar() || Minecraft.getMinecraft().currentScreen instanceof ActionBarGui)
return;
AccessorGuiIngame guiIngame = (AccessorGuiIngame) mc.ingameGUI;
if (guiIngame.getRecordPlayingUpFor() > 0) {
mc.mcProfiler.startSection("overlayMessage");
float hue = (float) guiIngame.getRecordPlayingUpFor() - partialTicks;
int opacity = (int) (hue * 256.0F / 20.0F);
if (opacity > 255) opacity = 255;

if (opacity > 0) {
int newX;
int newY;
if (WyvtilsConfig.INSTANCE.getActionBarPosition()) {
newX = WyvtilsConfig.INSTANCE.getActionBarX();
newY = WyvtilsConfig.INSTANCE.getActionBarY();
} else {
newX = -mc.fontRendererObj.getStringWidth(guiIngame.getRecordPlaying()) / 2;
newY = -4;
}
}
}

GlStateManager.pushMatrix();
if (!WyvtilsConfig.INSTANCE.getActionBarPosition() && WyvtilsConfig.INSTANCE.getActionBarCustomization())
GlStateManager.translate((float) (width / 2), (float) (height - 68), 0.0F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
int color = (guiIngame.getRecordIsPlaying() ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & Color.WHITE.getRGB() : Color.WHITE.getRGB());
mc.fontRendererObj.drawString(guiIngame.getRecordPlaying(), newX, newY, color | (opacity << 24), WyvtilsConfig.INSTANCE.getActionBarShadow());
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}
@Redirect(method = "renderRecordOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;translate(FFF)V"), remap = true)
private void removeTranslation(float x, float y, float z) {
if ((!WyvtilsConfig.INSTANCE.getActionBarPosition() && WyvtilsConfig.INSTANCE.getActionBarCustomization()) || !WyvtilsConfig.INSTANCE.getActionBarCustomization()) {
GlStateManager.translate(x, y, z);
}
}

mc.mcProfiler.endSection();
@Redirect(method = "renderRecordOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawString(Ljava/lang/String;III)I"), remap = true)
private int modifyDrawString(FontRenderer fontRenderer, String text, int x, int y, int color) {
if (!WyvtilsConfig.INSTANCE.getActionBarCustomization()) {
return fontRenderer.drawString(text, x, y, color);
} else {
int newX;
int newY;
if (WyvtilsConfig.INSTANCE.getActionBarPosition()) {
newX = WyvtilsConfig.INSTANCE.getActionBarX();
newY = WyvtilsConfig.INSTANCE.getActionBarY();
} else {
newX = x;
newY = y;
}
return fontRenderer.drawString(
text,
newX,
newY,
color,
WyvtilsConfig.INSTANCE.getActionBarShadow()
);
}
}

Expand All @@ -66,7 +79,7 @@ private void removeTitle(int width, int height, float partialTicks, CallbackInfo
}
}

@Redirect(method = "renderTitle", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V"))
@Redirect(method = "renderTitle", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V"), remap = true)
private void modifyTitleScale1(float x, float y, float z) {
if (WyvtilsConfig.INSTANCE.getTitleScale() == 1.0F && WyvtilsConfig.INSTANCE.getSubtitleScale() == 1.0F) {
GlStateManager.scale(x, y, z);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Wyvtilities - Utilities for Hypixel 1.8.9.
* Copyright (C) 2021 Wyvtilities
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.wyvest.wyvtilities.mixin;

import net.minecraft.client.Minecraft;
import net.wyvest.wyvtilities.config.WyvtilsConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Pseudo
@Mixin(targets = "club.sk1er.patcher.hooks.GuiIngameForgeHook")
public class MixinGuiIngameForgeHook {

@SuppressWarnings({"UnresolvedMixinReference", "DefaultAnnotationParam"})
@Inject(remap = false, method = "drawActionbarText", at = @At(remap = true, value = "HEAD"), cancellable = true)
private static void onActionBarTextDrawn(String recordPlaying, int color, CallbackInfo ci) {
if (!WyvtilsConfig.INSTANCE.getActionBarCustomization()) return;
int newX;
int newY;
if (WyvtilsConfig.INSTANCE.getActionBarPosition()) {
newX = WyvtilsConfig.INSTANCE.getActionBarX();
newY = WyvtilsConfig.INSTANCE.getActionBarY();
} else {
newX = -Minecraft.getMinecraft().fontRendererObj.getStringWidth(recordPlaying) >> 1;
newY = -4;
}
Minecraft.getMinecraft().fontRendererObj.drawString(
recordPlaying,
newX, newY,
color, WyvtilsConfig.INSTANCE.getActionBarShadow()
);
ci.cancel();
}

}
Loading

0 comments on commit df98814

Please sign in to comment.