diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2023-07-05 17:30:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-05 17:30:23 +0200 |
commit | d12f0d3d6935b516066bd750322b61230b194910 (patch) | |
tree | 69c26fde77d2c929611e386d09a2536549b4b732 /src/main/java/at | |
parent | a7e9a6c3aedaddfcdb7772d9164f9a32d5006bb7 (diff) | |
download | skyhanni-d12f0d3d6935b516066bd750322b61230b194910.tar.gz skyhanni-d12f0d3d6935b516066bd750322b61230b194910.tar.bz2 skyhanni-d12f0d3d6935b516066bd750322b61230b194910.zip |
Merge pull request #267
* added random code cleanups
* Merge branch 'beta' into random_code_cleanup
* ...
Diffstat (limited to 'src/main/java/at')
19 files changed, 10 insertions, 200 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java b/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java index ec1f4fbfc..137d58138 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java +++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java @@ -104,7 +104,7 @@ public class Position { if (wasPositiveX) { if (this.x < 0) { - deltaX += -this.x; + deltaX -= this.x; this.x = 0; } if (this.x > screenWidth) { @@ -138,7 +138,7 @@ public class Position { if (wasPositiveY) { if (this.y < 0) { - deltaY += -this.y; + deltaY -= this.y; this.y = 0; } if (this.y > screenHeight) { diff --git a/src/main/java/at/hannibal2/skyhanni/events/ItemClickEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ItemClickEvent.kt index 7b12f60cb..c0c4f4e83 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ItemClickEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ItemClickEvent.kt @@ -1,8 +1,5 @@ package at.hannibal2.skyhanni.events -import at.hannibal2.skyhanni.data.ClickType -import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt -import at.hannibal2.skyhanni.utils.LorenzVec import net.minecraft.item.ItemStack class ItemClickEvent(val itemInHand: ItemStack?) : LorenzEvent()
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt index 15bf00125..23991e31c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt @@ -111,14 +111,12 @@ class CompactBingoChat { private fun onNewAreaDiscovered(message: String): Boolean { if (message == " §r§6§lNEW AREA DISCOVERED!") { newArea = 1 - println("new area $newArea $message") return false } if (message != "") { if (newArea == 1) { newArea = 2 - println("new area $newArea $message") return false } @@ -127,7 +125,6 @@ class CompactBingoChat { return true } else { newArea = 0 - println("new area $newArea $message") } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index 0b7f14f2f..49bfb00da 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -429,7 +429,7 @@ class DamageIndicatorManager { return "" } - private fun checkBlazeSlayer(entity: EntityLiving, entityData: EntityData, health: Int, maxHealth: Int): String? { + private fun checkBlazeSlayer(entity: EntityLiving, entityData: EntityData, health: Int, maxHealth: Int): String { val shields = HellionShield.values() var found = false for (shield in shields) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/OldDamage.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/OldDamage.kt index 5cdb95aca..26c0a751a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/OldDamage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/OldDamage.kt @@ -1,4 +1,3 @@ package at.hannibal2.skyhanni.features.damageindicator -class OldDamage(val time: Long, val damage: Long, val healing: Long) { -}
\ No newline at end of file +class OldDamage(val time: Long, val damage: Long, val healing: Long)
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/EliteFarmingWeight.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/EliteFarmingWeight.kt index 497c25f0e..ca7ad1cc5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/EliteFarmingWeight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/EliteFarmingWeight.kt @@ -304,8 +304,8 @@ class EliteFarmingWeight { private fun specialMushroomWeight(weightPerCrop: MutableMap<CropType, Double>, totalWeight: Double): Double { val cactusWeight = weightPerCrop[CropType.CACTUS]!! val sugarCaneWeight = weightPerCrop[CropType.SUGAR_CANE]!! - val doubleBreakRatio = (cactusWeight + sugarCaneWeight) / totalWeight; - val normalRatio = (totalWeight - cactusWeight - sugarCaneWeight) / totalWeight; + val doubleBreakRatio = (cactusWeight + sugarCaneWeight) / totalWeight + val normalRatio = (totalWeight - cactusWeight - sugarCaneWeight) / totalWeight val mushroomFactor = CropType.MUSHROOM.getFactor() val mushroomCollection = CropType.MUSHROOM.getLocalCounter() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt index fb48d73fb..4d86c7a35 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils.chat import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.StringUtils.removeColor import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent import io.github.moulberry.notenoughupdates.events.SlotClickEvent import io.github.moulberry.notenoughupdates.util.Utils diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HideDeadEntities.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideDeadEntities.kt deleted file mode 100644 index 6bca8e97d..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/HideDeadEntities.kt +++ /dev/null @@ -1,38 +0,0 @@ -//package at.hannibal2.skyhanni.features.misc -// -//import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -//import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent -//import at.hannibal2.skyhanni.utils.LorenzUtils -//import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -// -// -//// Skytils feature does work already. -// -//class HideDeadEntities { -// private val hiddenEntities = mutableListOf<Int>() -// -// @SubscribeEvent -// fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { -// val entityId = event.entity.entityId -// -// if (event.health <= 0) { -// if (!hiddenEntities.contains(entityId)) { -// hiddenEntities.add(entityId) -// } -// } else { -// if (hiddenEntities.contains(entityId)) { -// hiddenEntities.remove(entityId) -// LorenzUtils.debug("respawned: ${event.entity.name}") -// } -// } -// } -// -// @SubscribeEvent -// fun onCheckRender(event: CheckRenderEntityEvent<*>) { -// if (!LorenzUtils.inSkyBlock) return -// -//// if (hiddenEntities.contains(event.entity.entityId)) { -//// event.isCanceled = true -//// } -// } -//}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt index 205314dce..5c7871a1e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt @@ -35,7 +35,7 @@ object QuickModMenuSwitch { Class.forName(path) add(Mod(name, mod.description, mod.command, mod.guiPath)) continue@out - } catch (ignored_: Exception) { + } catch (_: Exception) { } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/Quest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/Quest.kt index 230900153..e5cd68162 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/Quest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/Quest.kt @@ -9,5 +9,4 @@ abstract class Quest( val internalName: String, var state: QuestState, val displayName: String = internalName -) { -}
\ No newline at end of file +)
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt index d054ded6c..cb2c3def5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt @@ -18,7 +18,6 @@ import net.minecraftforge.fml.common.gameevent.TickEvent class SummoningSoulsName { - var tick = 0 private val texture = "ewogICJ0aW1lc3RhbXAiIDogMTYwMTQ3OTI2NjczMywKICAicHJvZmlsZUlkIiA6ICJmMzA1ZjA5NDI0NTg0ZjU" + "4YmEyYjY0ZjAyZDcyNDYyYyIsCiAgInByb2ZpbGVOYW1lIiA6ICJqcm9ja2EzMyIsCiAgInNpZ25hdH" + @@ -34,11 +33,8 @@ class SummoningSoulsName { fun onTick(event: TickEvent.ClientTickEvent) { if (!isEnabled()) return - tick++ //TODO use packets instead of this - if (tick % 1 == 0) { check() - } } private fun check() { diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/render/BlockRendererDispatcherHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/render/BlockRendererDispatcherHook.kt deleted file mode 100644 index 7a2a778e3..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/render/BlockRendererDispatcherHook.kt +++ /dev/null @@ -1,25 +0,0 @@ -//package at.hannibal2.skyhanni.mixins.hooks.render -// -//import at.hannibal2.skyhanni.events.RenderBlockInWorldEvent -//import net.minecraft.block.state.IBlockState -//import net.minecraft.client.renderer.BlockRendererDispatcher -//import net.minecraft.client.resources.model.IBakedModel -//import net.minecraft.util.BlockPos -//import net.minecraft.world.IBlockAccess -//import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable -// -//fun modifyGetModelFromBlockState( -// blockRendererDispatcher: Any, -// state: IBlockState?, -// worldIn: IBlockAccess, -// pos: BlockPos?, -// cir: CallbackInfoReturnable<IBakedModel> -//) { -// (blockRendererDispatcher as BlockRendererDispatcher).apply { -// val event = RenderBlockInWorldEvent(state, worldIn, pos) -// event.postAndCatch() -// if (event.state !== state) { -// cir.returnValue = blockModelShapes.getModelForState(event.state) -// } -// } -//}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java index ebd3161ce..d4e4156d1 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java @@ -12,26 +12,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(RenderItem.class) public abstract class MixinRenderItem { - // @Inject(method = "renderItemIntoGUI", at = @At("HEAD")) - // private void renderRarity(ItemStack stack, int x, int y, CallbackInfo ci) { - // RenderItemHookKt.renderRarity(stack, x, y, ci); - // } - @Inject(method = "renderItemOverlayIntoGUI", at = @At("RETURN")) private void renderItemOverlayPost(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text, CallbackInfo ci) { RenderItemHookKt.renderItemOverlayPost(fr, stack, xPosition, yPosition, text, ci); } - // @Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.scale(FFF)V", shift = At.Shift.AFTER)) - // private void renderItemPre(ItemStack stack, IBakedModel model, CallbackInfo ci) { - // RenderItemHookKt.renderItemPre(stack, model, ci); - // } - // - // @Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderEffect(Lnet/minecraft/client/resources/model/IBakedModel;)V", shift = At.Shift.BEFORE), cancellable = true) - // private void modifyGlintRendering(ItemStack stack, IBakedModel model, CallbackInfo ci) { - // RenderItemHookKt.modifyGlintRendering(stack, model, ci); - // } - @Inject(method = "renderEffect", at = @At("HEAD"), cancellable = true) public void onRenderEffect(CallbackInfo ci) { if (RenderItemHookKt.getSkipGlint()) { diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinBlockRendererDispatcher.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinBlockRendererDispatcher.java deleted file mode 100644 index 0714a6c2f..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinBlockRendererDispatcher.java +++ /dev/null @@ -1,13 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers.renderer; - -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.resources.IResourceManagerReloadListener; -import org.spongepowered.asm.mixin.Mixin; - -@Mixin(BlockRendererDispatcher.class) -public abstract class MixinBlockRendererDispatcher implements IResourceManagerReloadListener { -// @Inject(method = "getModelFromBlockState", at = @At("RETURN"), cancellable = true) -// private void modifyGetModelFromBlockState(IBlockState state, IBlockAccess worldIn, BlockPos pos, CallbackInfoReturnable<IBakedModel> cir) { -//// BlockRendererDispatcherHookKt.modifyGetModelFromBlockState(this, state, worldIn, pos, cir); -// } -} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChromaUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChromaUtils.kt deleted file mode 100644 index c1326fe8e..000000000 --- a/src/main/java/at/hannibal2/skyhanni/utils/ChromaUtils.kt +++ /dev/null @@ -1,61 +0,0 @@ -//package at.hannibal2.skyhanni.utils -// -//import at.hannibal2.skyhanni.utils.StringUtils.removeColor -//import net.minecraft.client.Minecraft -//import net.minecraft.util.EnumChatFormatting -//import java.util.regex.Matcher -//import java.util.regex.Pattern -// -//object ChromaUtils { -// -// private val CHROMA_REPLACE_PATTERN = Pattern.compile("\u00a7z(.+?)(?=\u00a7|$)") -// private val startTime = 0 -// -// fun chromaStringByColourCode(str: String): String? { -// var str = str -// if (str.contains("\u00a7z")) { -// val matcher: Matcher = CHROMA_REPLACE_PATTERN.matcher(str) -// val sb = StringBuffer() -// while (matcher.find()) { -// matcher.appendReplacement( -// sb, -// chromaString(matcher.group(1)) -// .replace("\\", "\\\\") -// .replace("$", "\\$") -// ) -// } -// matcher.appendTail(sb) -// str = sb.toString() -// } -// return str -// } -// -// fun chromaString(str: String): String? { -// return chromaString(str, 0f, false) -// } -// -// fun chromaString(str: String, offset: Float, bold: Boolean): String { -// var str = str -// str = str.removeColor() -// val currentTimeMillis = System.currentTimeMillis() -// if (startTime == 0L) startTime = -// currentTimeMillis -// var chromaSpeed: Int = NotEnoughUpdates.INSTANCE.config.misc.chromaSpeed -// if (chromaSpeed < 10) chromaSpeed = 10 -// if (chromaSpeed > 5000) chromaSpeed = 5000 -// val rainbowText = java.lang.StringBuilder() -// var len = 0 -// for (i in 0 until str.length) { -// val c = str[i] -// var index: Int = -// (offset + len / 12f - (currentTimeMillis - startTime) / chromaSpeed).toInt() % io..Utils.rainbow.size -// len += Minecraft.getMinecraft().fontRendererObj.getCharWidth(c) -// if (bold) len++ -// if (index < 0) index += io.github.moulberry.notenoughupdates.util.Utils.rainbow.size -// rainbowText.append(io.github.moulberry.notenoughupdates.util.Utils.rainbow.get(index)) -// if (bold) rainbowText.append(EnumChatFormatting.BOLD) -// rainbowText.append(c) -// } -// return rainbowText.toString() -// } -//}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt index bb199625d..83430cecb 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.utils -import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.features.misc.GhostCounter import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils import io.github.moulberry.notenoughupdates.util.XPInformation diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SpecialColour.java b/src/main/java/at/hannibal2/skyhanni/utils/SpecialColour.java index 6495873f4..8e71319aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SpecialColour.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/SpecialColour.java @@ -6,22 +6,9 @@ import java.awt.*; * Taken from NotEnoughUpdates */ public class SpecialColour { - public static String special(int chromaSpeed, int alpha, int rgb) { - return special(chromaSpeed, alpha, (rgb & 0xFF0000) >> 16, (rgb & 0x00FF00) >> 8, (rgb & 0x0000FF)); - } private static final int RADIX = 10; - public static String special(int chromaSpeed, int alpha, int r, int g, int b) { - StringBuilder sb = new StringBuilder(); - sb.append(Integer.toString(chromaSpeed, RADIX)).append(":"); - sb.append(Integer.toString(alpha, RADIX)).append(":"); - sb.append(Integer.toString(r, RADIX)).append(":"); - sb.append(Integer.toString(g, RADIX)).append(":"); - sb.append(Integer.toString(b, RADIX)); - return sb.toString(); - } - private static int[] decompose(String csv) { String[] split = csv.split(":"); @@ -33,17 +20,6 @@ public class SpecialColour { return arr; } - public static int specialToSimpleRGB(String special) { - int[] d = decompose(special); - int r = d[2]; - int g = d[1]; - int b = d[0]; - int a = d[3]; - int chr = d[4]; - - return (a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF); - } - public static int getSpeed(String special) { return decompose(special)[4]; } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java index 813020bc1..7482902a4 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java @@ -60,7 +60,7 @@ public class MayorJson { public Election election; } - public class Perk { + public static class Perk { @Expose public String name; @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ModsJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ModsJson.java index d765f3e02..9e04d55c7 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ModsJson.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ModsJson.java @@ -12,7 +12,7 @@ public class ModsJson { @Expose public Map<String, Mod> mods = new HashMap<>(); - public class Mod { + public static class Mod { @Expose public List<String> description = new ArrayList<>(); |