Skip to content

Commit 4b1fa0a

Browse files
committed
Current location should now detect dungeon. Fixed freeze backpack key now showing up in controls...
1 parent ba67032 commit 4b1fa0a

15 files changed

Lines changed: 74 additions & 42 deletions

File tree

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.2
8+
version = 1.5.2-beta.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
@@ -108,7 +108,7 @@ public void init(FMLInitializationEvent e) {
108108
new SkyblockKeyBinding("copy_NBT", Keyboard.KEY_RCONTROL, Message.KEY_DEVELOPER_COPY_NBT));
109109

110110
// Don't register the developer mode key on startup.
111-
registerKeyBindings(keyBindings.subList(0, 3));
111+
registerKeyBindings(keyBindings.subList(0, 4));
112112
}
113113

114114
@Mod.EventHandler

src/main/java/codes/biscuit/skyblockaddons/config/ConfigValues.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public class ConfigValues {
6363
private MutableObject<DiscordStatus> discordStatus = new MutableObject<>(DiscordStatus.AUTO_STATUS);
6464
private MutableObject<DiscordStatus> discordAutoDefault = new MutableObject<>(DiscordStatus.NONE);
6565
@Getter private List<String> discordCustomStatuses = new ArrayList<>();
66+
@Getter private MutableFloat mapZoom = new MutableFloat(0.18478261F); // 1.3
6667

6768
public ConfigValues(File settingsConfigFile) {
6869
this.settingsConfigFile = settingsConfigFile;
@@ -157,6 +158,8 @@ public void loadValues() {
157158
deserializeEnumValueFromOrdinal(discordAutoDefault, "discordAutoDefault");
158159
deserializeStringCollection(discordCustomStatuses, "discordCustomStatuses");
159160

161+
deserializeNumber(mapZoom, "mapZoom", float.class);
162+
160163
int configVersion;
161164
if (settingsConfig.has("configVersion")) {
162165
configVersion = settingsConfig.get("configVersion").getAsInt();
@@ -352,6 +355,8 @@ public void saveConfig() {
352355
}
353356
settingsConfig.add("discordCustomStatuses", discordCustomStatusesArray);
354357

358+
settingsConfig.addProperty("mapZoom", mapZoom);
359+
355360
settingsConfig.addProperty("configVersion", CONFIG_VERSION);
356361
int largestFeatureID = 0;
357362
for (Feature feature : Feature.values()) {
@@ -636,9 +641,7 @@ public Color getColor(Feature feature, int alpha) {
636641
}
637642

638643
if (chromaFeatures.contains(feature)) {
639-
Color color = ChromaManager.getCurrentColor();
640-
641-
return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
644+
return new Color(ChromaManager.getChromaColor(0, 0));
642645
}
643646

644647
Color color = getColor(feature);
@@ -648,7 +651,7 @@ public Color getColor(Feature feature, int alpha) {
648651

649652
public Color getColor(Feature feature) {
650653
if (chromaFeatures.contains(feature)) {
651-
return ChromaManager.getCurrentColor();
654+
return new Color(ChromaManager.getChromaColor(0, 0));
652655
}
653656

654657
ColorCode defaultColor = feature.getDefaultColor();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public enum Feature {
160160
MAKE_BACKPACK_INVENTORIES_COLORED, CHANGE_BAR_COLOR_FOR_POTIONS, ENABLE_MESSAGE_WHEN_BREAKING_STEMS,
161161
ENABLE_MESSAGE_WHEN_MINING_DEEP_CAVERNS, ENABLE_MESSAGE_WHEN_MINING_NETHER, HIDE_NIGHT_VISION_EFFECT_TIMER,
162162
CAKE_BAG_PREVIEW, BACKPACK_PREVIEW_AH, REPEAT_FULL_INVENTORY_WARNING, SORT_TAB_EFFECT_TIMERS, DOUBLE_WARP,
163-
REPEAT_SLAYER_BOSS_WARNING);
163+
REPEAT_SLAYER_BOSS_WARNING, ROTATE_MAP, CENTER_ROTATION_ON_PLAYER, MAP_ZOOM);
164164

165165
/**
166166
* Features that are considered gui ones. This is used for examnple when saving the config to ensure that these features'

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public enum Location {
7171
JERRY_POND("Jerry Pond"), // TODO RPC
7272
JERRYS_WORKSHOP("Jerry's Workshop"), // TODO RPC
7373

74+
DUNGEON("Dungeon"), // TODO RPC
75+
7476
/*
7577
Out of Bounds
7678
This is a valid location in Skyblock, it isn't a placeholder or a made up location.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,15 @@ private void removeChromaButtons() {
262262
}
263263

264264
private void addChromaButtons() {
265-
buttonList.add(new ButtonSlider(width / 2 + 76, 170+35, 70, 15, main, main.getConfigValues().getChromaSpeed(),
265+
buttonList.add(new ButtonSlider(width / 2 + 76, 170+35, 70, 15, main.getConfigValues().getChromaSpeed(),
266266
0.1F, 10, 0.5F, new ButtonSlider.OnSliderChangeCallback() {
267267
@Override
268268
public void sliderUpdated(float value) {
269269
main.getConfigValues().setChromaSpeed(value);
270270
}
271271
}));
272272

273-
buttonList.add(new ButtonSlider(width / 2 + 76, 170+35+35, 70, 15, main, main.getConfigValues().getChromaFadeWidth(),
273+
buttonList.add(new ButtonSlider(width / 2 + 76, 170+35+35, 70, 15, main.getConfigValues().getChromaFadeWidth(),
274274
1, 42, 1, new ButtonSlider.OnSliderChangeCallback() {
275275
@Override
276276
public void sliderUpdated(float value) {

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,16 @@ private void addButton(EnumUtils.FeatureSetting setting) {
362362
}
363363

364364
row += 0.4;
365+
} else if (setting == EnumUtils.FeatureSetting.MAP_ZOOM) {
366+
boxWidth = 100; // Default size and stuff.
367+
x = halfWidth-(boxWidth/2);
368+
y = getRowHeightSetting(row);
369+
buttonList.add(new ButtonSlider(x, y, 100, 20, main.getConfigValues().getMapZoom().getValue(), 0.5F, 5F, 0.1F, new ButtonSlider.OnSliderChangeCallback() {
370+
@Override
371+
public void sliderUpdated(float value) {
372+
main.getConfigValues().getMapZoom().setValue(value);
373+
}
374+
}).setPrefix("Map Zoom: "));
365375
} else {
366376
boxWidth = 31; // Default size and stuff.
367377
x = halfWidth-(boxWidth/2);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,15 @@ private void addButton(Feature feature, EnumUtils.ButtonType buttonType) {
441441
buttonList.add(new ButtonNormal(x, y, text, main, feature));
442442

443443
if (feature == Feature.CHROMA_SPEED) {
444-
buttonList.add(new ButtonSlider(x + 35, y + boxHeight - 23, 70, 15, main, main.getConfigValues().getChromaSpeed(),
444+
buttonList.add(new ButtonSlider(x + 35, y + boxHeight - 23, 70, 15, main.getConfigValues().getChromaSpeed(),
445445
0.1F, 10, 0.5F, new ButtonSlider.OnSliderChangeCallback() {
446446
@Override
447447
public void sliderUpdated(float value) {
448448
main.getConfigValues().setChromaSpeed(value);
449449
}
450450
}));
451451
} else if (feature == Feature.CHROMA_FADE_WIDTH) {
452-
buttonList.add(new ButtonSlider(x + 35, y + boxHeight - 23, 70, 15, main, main.getConfigValues().getChromaFadeWidth(),
452+
buttonList.add(new ButtonSlider(x + 35, y + boxHeight - 23, 70, 15, main.getConfigValues().getChromaFadeWidth(),
453453
1, 42, 1, new ButtonSlider.OnSliderChangeCallback() {
454454
@Override
455455
public void sliderUpdated(float value) {

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ public class ButtonSlider extends GuiButton {
1818
private float sliderValue;
1919
private boolean dragging;
2020

21-
private SkyblockAddons main;
21+
private SkyblockAddons main = SkyblockAddons.getInstance();
2222

2323
private OnSliderChangeCallback sliderCallback;
2424

25-
public ButtonSlider(double x, double y, int width, int height, SkyblockAddons main, float initialValue,
25+
private String prefix = null;
26+
27+
public ButtonSlider(double x, double y, int width, int height, float initialValue,
2628
float min, float max, float step, OnSliderChangeCallback sliderCallback) {
2729
super(0, (int)x, (int)y, "");
2830
this.sliderValue = 0;
2931
this.displayString = "";
3032
this.sliderValue = initialValue;
31-
this.main = main;
3233
this.width = width;
3334
this.height = height;
3435
this.sliderCallback = sliderCallback;
@@ -107,12 +108,18 @@ public float denormalizeScale(float value) {
107108

108109
public void valueUpdated() {
109110
sliderCallback.sliderUpdated(sliderValue);
110-
this.displayString = String.valueOf(getRoundedValue(denormalizeScale(sliderValue)));
111+
this.displayString = (prefix != null ? prefix : "") + getRoundedValue(denormalizeScale(sliderValue));
111112
}
112113

113114
public abstract static class OnSliderChangeCallback {
114115

115116
public abstract void sliderUpdated(float value);
116117
}
118+
119+
public ButtonSlider setPrefix(String text) {
120+
prefix = text;
121+
this.displayString = prefix + getRoundedValue(denormalizeScale(sliderValue));
122+
return this;
123+
}
117124
}
118125

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
import codes.biscuit.skyblockaddons.misc.ChromaManager;
2222
import codes.biscuit.skyblockaddons.misc.Updater;
2323
import codes.biscuit.skyblockaddons.misc.scheduler.Scheduler;
24+
import codes.biscuit.skyblockaddons.utils.ColorCode;
2425
import codes.biscuit.skyblockaddons.utils.EnumUtils;
2526
import codes.biscuit.skyblockaddons.utils.TextUtils;
26-
import codes.biscuit.skyblockaddons.utils.ColorCode;
2727
import codes.biscuit.skyblockaddons.utils.objects.IntPair;
2828
import lombok.Getter;
2929
import lombok.Setter;
3030
import net.minecraft.client.Minecraft;
3131
import net.minecraft.client.gui.Gui;
32+
import net.minecraft.client.gui.MapItemRenderer;
3233
import net.minecraft.client.gui.ScaledResolution;
3334
import net.minecraft.client.renderer.GlStateManager;
3435
import net.minecraft.client.renderer.RenderHelper;
@@ -40,10 +41,14 @@
4041
import net.minecraft.item.ItemStack;
4142
import net.minecraft.nbt.NBTTagCompound;
4243
import net.minecraft.nbt.NBTTagList;
44+
import net.minecraft.util.MathHelper;
4345
import net.minecraft.util.ResourceLocation;
46+
import net.minecraft.util.Vec4b;
47+
import net.minecraft.world.storage.MapData;
4448
import net.minecraftforge.client.GuiIngameForge;
4549
import net.minecraftforge.client.event.RenderGameOverlayEvent;
4650
import net.minecraftforge.client.event.RenderLivingEvent;
51+
import net.minecraftforge.client.event.RenderWorldLastEvent;
4752
import net.minecraftforge.fml.client.GuiNotification;
4853
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
4954
import net.minecraftforge.fml.common.gameevent.TickEvent;

0 commit comments

Comments
 (0)