Skip to content

Commit e366146

Browse files
committed
More bug fixes, ready for 1.5.1 patch release.
1 parent b1966a8 commit e366146

File tree

19 files changed

+74
-66
lines changed

19 files changed

+74
-66
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2G
55
# SkyblockAddons Properties
66
modId = skyblockaddons
77
modName = SkyblockAddons
8-
version = 1.5.0
8+
version = 1.5.1
99
acceptedMinecraftVersions = [1.8.9]
1010
minecraftVersion = 1.8.9
1111
forgeVersion = 11.15.1.2318-1.8.9

src/main/java/codes/biscuit/skyblockaddons/SkyblockAddons.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public KeyBinding getFreezeBackpackKey() {
206206
static {
207207
//noinspection ConstantConditions
208208
if (VERSION.contains("@")) { // Debug environment...
209-
VERSION = "1.5.0";
209+
VERSION = "1.5.1";
210210
}
211211
}
212212
}

src/main/java/codes/biscuit/skyblockaddons/asm/hooks/ModelEndermanHook.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ModelEndermanHook {
1111

1212
public static void setEndermanColor() {
1313
SkyblockAddons main = SkyblockAddons.getInstance();
14-
if (main.getUtils().isOnSkyblock() && main.getUtils().getLocation() == Location.THE_END && main.getConfigValues().isEnabled(Feature.CHANGE_ZEALOT_COLOR)) {
14+
if (main.getUtils().isOnSkyblock() && main.getUtils().getLocation() == Location.DRAGONS_NEST && main.getConfigValues().isEnabled(Feature.CHANGE_ZEALOT_COLOR)) {
1515
Color color = main.getConfigValues().getColor(Feature.CHANGE_ZEALOT_COLOR);
1616
GlStateManager.color((float)color.getRed()/255, (float)color.getGreen()/255, (float)color.getBlue()/255);
1717
}

src/main/java/codes/biscuit/skyblockaddons/asm/hooks/PlayerControllerMPHook.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import codes.biscuit.skyblockaddons.core.Location;
77
import codes.biscuit.skyblockaddons.core.Message;
88
import codes.biscuit.skyblockaddons.utils.*;
9+
import codes.biscuit.skyblockaddons.utils.item.ItemUtils;
910
import net.minecraft.block.Block;
1011
import net.minecraft.client.Minecraft;
1112
import net.minecraft.client.entity.EntityPlayerSP;
@@ -193,9 +194,14 @@ public static void onWindowClick(int slotNum, int mouseButtonClicked, int mode,
193194
if (main.getConfigValues().isEnabled(Feature.LOCK_SLOTS)
194195
&& main.getConfigValues().getLockedSlots().contains(slotNum)
195196
&& (slotNum >= 9 || player.openContainer instanceof ContainerPlayer && slotNum >= 5)) {
196-
if (mouseButtonClicked == 1 && mode == 0 && slotIn != null && slotIn.getHasStack() &&
197-
slotIn.getStack().getItem() == Items.skull && BackpackManager.isBackpack(slotIn.getStack())) {
198-
return;
197+
if (mouseButtonClicked == 1 && mode == 0 && slotIn != null && slotIn.getHasStack() && slotIn.getStack().getItem() == Items.skull) {
198+
199+
String itemID = ItemUtils.getSkyBlockItemID(slotIn.getStack());
200+
if (itemID == null) itemID = "";
201+
202+
if (BackpackManager.isBackpack(slotIn.getStack()) || itemID.contains("SACK")) {
203+
return;
204+
}
199205
}
200206

201207
main.getUtils().playLoudSound("note.bass", 0.5);

src/main/java/codes/biscuit/skyblockaddons/core/Feature.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ public enum Feature {
142142
TEXT_STYLE(-1, Message.SETTING_TEXT_STYLE, false),
143143
CHROMA_SPEED(-1, Message.SETTING_CHROMA_SPEED, false),
144144
CHROMA_MODE(-1, Message.SETTING_CHROMA_MODE, false),
145-
CHROMA_FADE_WIDTH(-1, Message.SETTING_CHROMA_FADE_WIDTH, false);
145+
CHROMA_FADE_WIDTH(-1, Message.SETTING_CHROMA_FADE_WIDTH, false),
146+
TURN_ALL_FEATURES_CHROMA(-1, Message.SETTING_TURN_ALL_FEATURES_CHROMA, false);
146147

147148
/**
148149
* These are "features" that are not actually features, but just hold the place of a setting. If you are adding any new settings and create
@@ -168,7 +169,7 @@ public enum Feature {
168169
/**
169170
* These are features that are displayed separate, on the general tab.
170171
*/
171-
@Getter private static final Set<Feature> generalTabFeatures = new LinkedHashSet<>(Arrays.asList(TEXT_STYLE, WARNING_TIME, CHROMA_SPEED, CHROMA_MODE, CHROMA_FADE_WIDTH));
172+
@Getter private static final Set<Feature> generalTabFeatures = new LinkedHashSet<>(Arrays.asList(TEXT_STYLE, WARNING_TIME, CHROMA_SPEED, CHROMA_MODE, CHROMA_FADE_WIDTH, TURN_ALL_FEATURES_CHROMA));
172173

173174
private int id;
174175
private Message message;

src/main/java/codes/biscuit/skyblockaddons/core/Message.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public enum Message {
129129
SETTING_DISABLE_ENDERMAN_TELEPORTATION_EFFECT(MessageObject.SETTING, "disableEndermanTeleportation"),
130130
SETTING_CHANGE_ZEALOT_COLOR(MessageObject.SETTING, "changeZealotColor"),
131131
SETTING_HIDE_SVEN_PUP_NAMETAGS(MessageObject.SETTING, "hideSvenPupNametags"),
132+
SETTING_TURN_ALL_FEATURES_CHROMA(MessageObject.SETTING, "turnAllFeaturesChroma"),
132133

133134
BACKPACK_STYLE_REGULAR(MessageObject.BACKPACK_STYLE, "regular"),
134135
BACKPACK_STYLE_COMPACT(MessageObject.BACKPACK_STYLE, "compact"),
@@ -184,7 +185,8 @@ public enum Message {
184185
MESSAGE_LEGENDARY_SEA_CREATURE_WARNING(MessageObject.MESSAGES, "legendarySeaCreatureWarning"),
185186
MESSAGE_CANCELLED_NON_LOGS_BREAK(MessageObject.MESSAGES, "cancelledPark"),
186187
MESSAGE_BOSS_APPROACH_ALERT(MessageObject.MESSAGES, "bossApproaching"),
187-
188+
MESSAGE_ENABLE_ALL(MessageObject.MESSAGES, "enableAll"),
189+
MESSAGE_DISABLE_ALL(MessageObject.MESSAGES, "disableAll"),
188190

189191
@Deprecated ANCHOR_POINT_TOP_LEFT(MessageObject.ANCHOR_POINT, "topLeft"),
190192
@Deprecated ANCHOR_POINT_TOP_RIGHT(MessageObject.ANCHOR_POINT, "topRight"),

src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void initGui() {
127127

128128
for (Feature feature : features) {
129129
if (skip == 0) {
130-
if (feature == Feature.TEXT_STYLE || feature == Feature.WARNING_TIME || feature == Feature.CHROMA_MODE) {
130+
if (feature == Feature.TEXT_STYLE || feature == Feature.WARNING_TIME || feature == Feature.CHROMA_MODE || feature == Feature.TURN_ALL_FEATURES_CHROMA) {
131131
addButton(feature, EnumUtils.ButtonType.SOLID);
132132
} else if (feature == Feature.CHROMA_SPEED || feature == Feature.CHROMA_FADE_WIDTH) {
133133
addButton(feature, EnumUtils.ButtonType.CHROMA_SLIDER);
@@ -253,6 +253,27 @@ protected void actionPerformed(GuiButton abstractButton) {
253253
cancelClose = true;
254254
Minecraft.getMinecraft().displayGuiScreen(new SkyblockAddonsGui(main, page, tab));
255255
cancelClose = false;
256+
} else if (feature == Feature.TURN_ALL_FEATURES_CHROMA) {
257+
boolean enable = false;
258+
259+
for (Feature loopFeature : Feature.values()) {
260+
if (loopFeature.getGuiFeatureData() != null && loopFeature.getGuiFeatureData().getDefaultColor() != null) {
261+
if (!main.getConfigValues().getChromaFeatures().contains(loopFeature)) {
262+
enable = true;
263+
break;
264+
}
265+
}
266+
}
267+
268+
for (Feature loopFeature : Feature.values()) {
269+
if (loopFeature.getGuiFeatureData() != null && loopFeature.getGuiFeatureData().getDefaultColor() != null) {
270+
if (enable) {
271+
main.getConfigValues().getChromaFeatures().add(loopFeature);
272+
} else {
273+
main.getConfigValues().getChromaFeatures().remove(loopFeature);
274+
}
275+
}
276+
}
256277
}
257278
} else if (abstractButton instanceof ButtonModify) {
258279
if (feature == Feature.ADD) {
@@ -400,7 +421,7 @@ private void addButton(Feature feature, EnumUtils.ButtonType buttonType) {
400421
} else if (buttonType == EnumUtils.ButtonType.SOLID) {
401422
buttonList.add(new ButtonNormal(x, y, text, main, feature));
402423

403-
if (feature == Feature.TEXT_STYLE || feature == Feature.CHROMA_MODE) {
424+
if (feature == Feature.TEXT_STYLE || feature == Feature.CHROMA_MODE || feature == Feature.TURN_ALL_FEATURES_CHROMA) {
404425
buttonList.add(new ButtonSolid(x+10, y + boxHeight - 23, 120, 15, "", main, feature));
405426
} else if (feature == Feature.WARNING_TIME) {
406427
int solidButtonX = x+(boxWidth/2)-17;

src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSolid.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import codes.biscuit.skyblockaddons.SkyblockAddons;
44
import codes.biscuit.skyblockaddons.core.Feature;
5+
import codes.biscuit.skyblockaddons.core.Message;
56
import codes.biscuit.skyblockaddons.utils.nifty.reflection.MinecraftReflection;
67
import net.minecraft.client.Minecraft;
78
import net.minecraft.client.audio.SoundHandler;
@@ -38,6 +39,17 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) {
3839
displayString = main.getConfigValues().getChromaMode().getMessage();
3940
} else if (feature == Feature.WARNING_TIME) {
4041
displayString = main.getConfigValues().getWarningSeconds()+"s";
42+
} else if (feature == Feature.TURN_ALL_FEATURES_CHROMA) {
43+
boolean enable = false;
44+
for (Feature loopFeature : Feature.values()) {
45+
if (loopFeature.getGuiFeatureData() != null && loopFeature.getGuiFeatureData().getDefaultColor() != null) {
46+
if (!main.getConfigValues().getChromaFeatures().contains(loopFeature)) {
47+
enable = true;
48+
break;
49+
}
50+
}
51+
}
52+
displayString = (enable ? Message.MESSAGE_ENABLE_ALL : Message.MESSAGE_DISABLE_ALL).getMessage();
4153
}
4254
int alpha;
4355
float alphaMultiplier = 1F;

src/main/java/codes/biscuit/skyblockaddons/gui/buttons/IslandButton.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY, boolean actuallyDra
178178
}
179179

180180
mc.getTextureManager().bindTexture(island.getResourceLocation());
181-
SkyblockAddons.getInstance().getUtils().drawModalRectWithCustomSizedTexture(x, y, 0, 0, w, h, w, h, true);
181+
SkyblockAddons.getInstance().getUtils().drawModalRectWithCustomSizedTexture(x, y, 0, 0, w, h, w, h);
182182

183183
for (IslandMarkerButton marker : markerButtons) {
184184
marker.drawButton(x, y, expansion, hovered, unlocked, this.markers.get(marker.getMarker()));

src/main/java/codes/biscuit/skyblockaddons/listeners/RenderListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private void renderWarnings(ScaledResolution scaledResolution) {
214214

215215
float scale = 4; // Scale is normally 4, but if its larger than the screen, scale it down...
216216
if (stringWidth*scale > (scaledWidth*0.9F)) {
217-
scale = scaledWidth/(float)stringWidth;
217+
scale = (scaledWidth*0.9F)/(float)stringWidth;
218218
}
219219

220220
GlStateManager.pushMatrix();
@@ -259,7 +259,7 @@ private void renderWarnings(ScaledResolution scaledResolution) {
259259

260260
float scale = 2; // Scale is normally 2, but if its larger than the screen, scale it down...
261261
if (stringWidth*scale > (scaledWidth*0.9F)) {
262-
scale = scaledWidth/(float)stringWidth;
262+
scale = (scaledWidth*0.9F)/(float)stringWidth;
263263
}
264264

265265
GlStateManager.pushMatrix();
@@ -1280,7 +1280,7 @@ private void drawCompactPowerOrbStatus(Minecraft mc, float scale, ButtonLocation
12801280
main.getUtils().enableStandardGLOptions();
12811281

12821282
mc.getTextureManager().bindTexture(powerOrb.getResourceLocation());
1283-
main.getUtils().drawModalRectWithCustomSizedTexture(x, y, 0, 0, iconSize, iconSize, iconSize, iconSize, false);
1283+
main.getUtils().drawModalRectWithCustomSizedTexture(x, y, 0, 0, iconSize, iconSize, iconSize, iconSize);
12841284

12851285
main.getUtils().drawTextWithStyle(secondsString, x + spacing + iconSize, y + (iconSize / 2F) - (8 / 2F), ChatFormatting.WHITE.getColor(255).getRGB());
12861286

@@ -1341,7 +1341,7 @@ private void drawDetailedPowerOrbStatus(Minecraft mc, float scale, ButtonLocatio
13411341
main.getUtils().enableStandardGLOptions();
13421342

13431343
mc.getTextureManager().bindTexture(powerOrb.getResourceLocation());
1344-
main.getUtils().drawModalRectWithCustomSizedTexture(x, y, 0, 0, iconSize, iconSize, iconSize, iconSize, false);
1344+
main.getUtils().drawModalRectWithCustomSizedTexture(x, y, 0, 0, iconSize, iconSize, iconSize, iconSize);
13451345

13461346
String secondsString = String.format("§e%ss", seconds);
13471347
main.getUtils().drawTextWithStyle(secondsString, Math.round(x + (iconSize / 2F) - (MinecraftReflection.FontRenderer.getStringWidth(secondsString) / 2F)), y + iconSize, ChatFormatting.WHITE.getColor(255).getRGB());

0 commit comments

Comments
 (0)