aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-09-07 16:01:48 -0400
committerbowser0000 <bowser0000@gmail.com>2021-09-07 16:01:48 -0400
commitf64d52798778df323f4e7778fff98e240cde4e83 (patch)
tree43e4888083fb7e54e9fecfd3f7bc118c0e17c884 /src
parent0707ac473037146819c5a43c808b6ee41f014a63 (diff)
downloadSkyblockMod-f64d52798778df323f4e7778fff98e240cde4e83.tar.gz
SkyblockMod-f64d52798778df323f4e7778fff98e240cde4e83.tar.bz2
SkyblockMod-f64d52798778df323f4e7778fff98e240cde4e83.zip
Fix S+ runs not saving and spirit boots fix NPE
Diffstat (limited to 'src')
-rw-r--r--src/main/java/me/Danker/features/SpiritBootsFix.java6
-rw-r--r--src/main/java/me/Danker/features/loot/CatacombsTracker.java14
2 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/me/Danker/features/SpiritBootsFix.java b/src/main/java/me/Danker/features/SpiritBootsFix.java
index 8719fcf..8530f17 100644
--- a/src/main/java/me/Danker/features/SpiritBootsFix.java
+++ b/src/main/java/me/Danker/features/SpiritBootsFix.java
@@ -3,6 +3,7 @@ package me.Danker.features;
import me.Danker.events.PacketReadEvent;
import me.Danker.utils.Utils;
import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.play.server.S04PacketEntityEquipment;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
@@ -16,8 +17,11 @@ public class SpiritBootsFix {
@SubscribeEvent
public void onPacketRead(PacketReadEvent event) throws IllegalAccessException {
if (Utils.inSkyblock && event.packet instanceof S04PacketEntityEquipment) {
+ EntityPlayer player = Minecraft.getMinecraft().thePlayer;
S04PacketEntityEquipment packet = (S04PacketEntityEquipment) event.packet;
- if (packet.getEntityID() == Minecraft.getMinecraft().thePlayer.getEntityId()) {
+
+ if (player == null || packet == null) return;
+ if (packet.getEntityID() == player.getEntityId()) {
slot.setAccessible(true);
slot.setInt(packet, slot.getInt(packet) + 1);
event.packet = packet;
diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java
index a581db5..6e62b45 100644
--- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java
+++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java
@@ -179,31 +179,31 @@ public class CatacombsTracker {
if (sCleaned.contains("F1")) {
f1SPlus++;
f1SPlusSession++;
- ConfigHandler.writeDoubleConfig("catacombs", "floorOneSPlus", f1SPlus);
+ ConfigHandler.writeIntConfig("catacombs", "floorOneSPlus", f1SPlus);
} else if (sCleaned.contains("F2")) {
f2SPlus++;
f2SPlusSession++;
- ConfigHandler.writeDoubleConfig("catacombs", "floorTwoSPlus", f2SPlus);
+ ConfigHandler.writeIntConfig("catacombs", "floorTwoSPlus", f2SPlus);
} else if (sCleaned.contains("F3")) {
f3SPlus++;
f3SPlusSession++;
- ConfigHandler.writeDoubleConfig("catacombs", "floorThreeSPlus", f3SPlus);
+ ConfigHandler.writeIntConfig("catacombs", "floorThreeSPlus", f3SPlus);
} else if (sCleaned.contains("F4")) {
f4SPlus++;
f4SPlusSession++;
- ConfigHandler.writeDoubleConfig("catacombs", "floorFourSPlus", f4SPlus);
+ ConfigHandler.writeIntConfig("catacombs", "floorFourSPlus", f4SPlus);
} else if (sCleaned.contains("F5")) {
f5SPlus++;
f5SPlusSession++;
- ConfigHandler.writeDoubleConfig("catacombs", "floorFiveSPlus", f5SPlus);
+ ConfigHandler.writeIntConfig("catacombs", "floorFiveSPlus", f5SPlus);
} else if (sCleaned.contains("F6")) {
f6SPlus++;
f6SPlusSession++;
- ConfigHandler.writeDoubleConfig("catacombs", "floorSixSPlus", f6SPlus);
+ ConfigHandler.writeIntConfig("catacombs", "floorSixSPlus", f6SPlus);
} else if (sCleaned.contains("F7")) {
f7SPlus++;
f7SPlusSession++;
- ConfigHandler.writeDoubleConfig("catacombs", "floorSevenSPlus", f7SPlus);
+ ConfigHandler.writeIntConfig("catacombs", "floorSevenSPlus", f7SPlus);
}
}
}