diff options
author | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2021-04-23 10:42:40 -0400 |
---|---|---|
committer | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2021-04-23 10:42:40 -0400 |
commit | f9ab1d2c9cbf7e379ce6d897578cd92cc4192071 (patch) | |
tree | 131a86d0a276a867d11aa9cc039cf90d76fae79a /src/main | |
parent | 3a6b2116b398631ee922170ef5ecfc0e1419976a (diff) | |
download | SkytilsMod-f9ab1d2c9cbf7e379ce6d897578cd92cc4192071.tar.gz SkytilsMod-f9ab1d2c9cbf7e379ce6d897578cd92cc4192071.tar.bz2 SkytilsMod-f9ab1d2c9cbf7e379ce6d897578cd92cc4192071.zip |
More Visible Ghosts
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/skytils/skytilsmod/mixins/MixinLayerCreeperCharge.java | 45 | ||||
-rw-r--r-- | src/main/kotlin/skytils/skytilsmod/core/Config.kt | 10 | ||||
-rw-r--r-- | src/main/kotlin/skytils/skytilsmod/utils/SBInfo.kt | 1 | ||||
-rw-r--r-- | src/main/resources/assets/skytils/creeper_armor.png | bin | 0 -> 189 bytes | |||
-rw-r--r-- | src/main/resources/mixins.skytils.json | 1 |
5 files changed, 57 insertions, 0 deletions
diff --git a/src/main/java/skytils/skytilsmod/mixins/MixinLayerCreeperCharge.java b/src/main/java/skytils/skytilsmod/mixins/MixinLayerCreeperCharge.java new file mode 100644 index 00000000..ea9f0d5d --- /dev/null +++ b/src/main/java/skytils/skytilsmod/mixins/MixinLayerCreeperCharge.java @@ -0,0 +1,45 @@ +/* + * Skytils - Hypixel Skyblock Quality of Life Mod + * Copyright (C) 2021 Skytils + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package skytils.skytilsmod.mixins; + +import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.util.ResourceLocation; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import skytils.skytilsmod.Skytils; +import skytils.skytilsmod.utils.SBInfo; + +import java.util.Objects; + +@Mixin(LayerCreeperCharge.class) +public abstract class MixinLayerCreeperCharge implements LayerRenderer<EntityCreeper> { + + ResourceLocation VISIBLE_CREEPER_ARMOR = new ResourceLocation("skytils", "creeper_armor.png"); + + @ModifyArg(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderCreeper;bindTexture(Lnet/minecraft/util/ResourceLocation;)V")) + private ResourceLocation modifyChargedCreeperLayer(ResourceLocation res) { + if (Skytils.config.moreVisibleGhosts && Objects.equals(SBInfo.instance.getMode(), "mining_3")) { + res = VISIBLE_CREEPER_ARMOR; + } + return res; + } +} diff --git a/src/main/kotlin/skytils/skytilsmod/core/Config.kt b/src/main/kotlin/skytils/skytilsmod/core/Config.kt index 93488e3d..84bbdaf8 100644 --- a/src/main/kotlin/skytils/skytilsmod/core/Config.kt +++ b/src/main/kotlin/skytils/skytilsmod/core/Config.kt @@ -686,6 +686,16 @@ class Config : Vigilant(File("./config/skytils/config.toml"), "Skytils") { @Property( type = PropertyType.SWITCH, + name = "More Visible Ghosts", + description = "Makes ghosts more visible in the Dwarven Mines.\nThis is allowed on the Hypixel network and can be done in Vanilla.", + category = "Mining", + subcategory = "Quality of Life" + ) + @JvmField + var moreVisibleGhosts = false + + @Property( + type = PropertyType.SWITCH, name = "Powder Ghast Ping", description = "Displays a title on your screen when a Powder Ghast spawns.", category = "Mining", diff --git a/src/main/kotlin/skytils/skytilsmod/utils/SBInfo.kt b/src/main/kotlin/skytils/skytilsmod/utils/SBInfo.kt index acccdc92..88244b08 100644 --- a/src/main/kotlin/skytils/skytilsmod/utils/SBInfo.kt +++ b/src/main/kotlin/skytils/skytilsmod/utils/SBInfo.kt @@ -158,6 +158,7 @@ class SBInfo { } companion object { + @JvmField val instance = SBInfo() private val timePattern = Pattern.compile(".+(am|pm)") private val JSON_BRACKET_PATTERN = Pattern.compile("\\{.+}") diff --git a/src/main/resources/assets/skytils/creeper_armor.png b/src/main/resources/assets/skytils/creeper_armor.png Binary files differnew file mode 100644 index 00000000..6e71a9ea --- /dev/null +++ b/src/main/resources/assets/skytils/creeper_armor.png diff --git a/src/main/resources/mixins.skytils.json b/src/main/resources/mixins.skytils.json index 25b582c7..6a7a858a 100644 --- a/src/main/resources/mixins.skytils.json +++ b/src/main/resources/mixins.skytils.json @@ -20,6 +20,7 @@ "MixinGuiScreen", "MixinItemArmor", "MixinItemStack", + "MixinLayerCreeperCharge", "MixinLayerCustomHead", "MixinMinecraft", "MixinModelBlaze", |