Skip to content

Commit 6b073b2

Browse files
P3nguinMinecraftSychic
authored andcommitted
fix: smolpeople/breefingdog
1 parent a83483c commit 6b073b2

File tree

6 files changed

+109
-19
lines changed

6 files changed

+109
-19
lines changed

mod/src/main/java/gg/skytils/skytilsmod/mixins/transformers/entity/MixinEntityLivingBase.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ private boolean spawnParticle(World instance, Entity entity, byte b) {
8282
//#endif
8383
}
8484

85-
@Inject(method = "isBaby", at = @At("HEAD"), cancellable = true)
86-
private void setChildState(CallbackInfoReturnable<Boolean> cir) {
87-
hook.isChild(cir);
88-
}
89-
9085
@NotNull
9186
@Override
9287
public EntityLivingBaseHook getSkytilsHook() {
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Skytils - Hypixel Skyblock Quality of Life Mod
3+
* Copyright (C) 2020-2025 Skytils
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published
7+
* by the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package gg.skytils.skytilsmod.mixins.transformers.renderer;
20+
21+
import gg.skytils.skytilsmod.mixins.extensions.ExtensionPlayerEntityRenderer;
22+
import gg.skytils.skytilsmod.mixins.hooks.renderer.PlayerEntityRendererHook;
23+
import net.minecraft.client.render.entity.PlayerEntityRenderer;
24+
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
25+
import net.minecraft.client.util.math.MatrixStack;
26+
import org.jetbrains.annotations.NotNull;
27+
import org.spongepowered.asm.mixin.Mixin;
28+
import org.spongepowered.asm.mixin.injection.At;
29+
import org.spongepowered.asm.mixin.injection.Inject;
30+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
31+
32+
@Mixin(PlayerEntityRenderer.class)
33+
public class MixinPlayerEntityRenderer implements ExtensionPlayerEntityRenderer {
34+
private static final PlayerEntityRendererHook hook = new PlayerEntityRendererHook();
35+
36+
@Inject(method = "scale(Lnet/minecraft/client/render/entity/state/PlayerEntityRenderState;Lnet/minecraft/client/util/math/MatrixStack;)V", at = @At("HEAD"))
37+
private static void doScale(PlayerEntityRenderState playerEntityRenderState, MatrixStack matrixStack, CallbackInfo ci){
38+
hook.smol(playerEntityRenderState, matrixStack);
39+
}
40+
41+
@NotNull
42+
@Override
43+
public PlayerEntityRendererHook getSkytilsHook() {
44+
return hook;
45+
}
46+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Skytils - Hypixel Skyblock Quality of Life Mod
3+
* Copyright (C) 2020-2025 Skytils
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published
7+
* by the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package gg.skytils.skytilsmod.mixins.extensions
20+
21+
import gg.skytils.skytilsmod.mixins.hooks.renderer.PlayerEntityRendererHook
22+
interface ExtensionPlayerEntityRenderer {
23+
val skytilsHook: PlayerEntityRendererHook
24+
}

mod/src/main/kotlin/gg/skytils/skytilsmod/mixins/hooks/entity/EntityLivingBaseHook.kt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ class EntityLivingBaseHook(val entity: LivingEntity) {
4343
var colorMultiplier: Color? = null
4444
var masterDragonType: WitherKingDragons? = null
4545

46-
val isBreefing by lazy {
47-
entity.name.string == "Breefing" && (SuperSecretSettings.breefingDog || Random.nextInt(
48-
100
49-
) < 3)
50-
}
51-
52-
val isSmol by lazy {
53-
Utils.inSkyblock && entity is PlayerEntity && (SuperSecretSettings.smolPeople || isBreefing)
54-
}
55-
5646
//#if MC>12000
5747
fun modifyPotionActive(statusEffect: StatusEffect, cir: CallbackInfoReturnable<Boolean>) {
5848
if (!Utils.inSkyblock) return
@@ -78,8 +68,4 @@ class EntityLivingBaseHook(val entity: LivingEntity) {
7868
//$$ return !Skytils.config.hideDeathParticles || !Utils.inSkyblock || particleType != ParticleTypes.EXPLOSION
7969
//$$ }
8070
//#endif
81-
82-
fun isChild(cir: CallbackInfoReturnable<Boolean>) {
83-
cir.returnValue = isSmol
84-
}
8571
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Skytils - Hypixel Skyblock Quality of Life Mod
3+
* Copyright (C) 2020-2025 Skytils
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published
7+
* by the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package gg.skytils.skytilsmod.mixins.hooks.renderer
20+
21+
import gg.skytils.skytilsmod.utils.SuperSecretSettings
22+
import gg.skytils.skytilsmod.utils.Utils
23+
import net.minecraft.client.render.entity.state.PlayerEntityRenderState
24+
import net.minecraft.client.util.math.MatrixStack
25+
import kotlin.random.Random
26+
27+
class PlayerEntityRendererHook {
28+
fun isBreefing(state: PlayerEntityRenderState): Boolean
29+
= state.name == "Breefing" && (SuperSecretSettings.breefingDog || Random.nextInt(
30+
100
31+
) < 3)
32+
33+
fun smol(state: PlayerEntityRenderState, ms: MatrixStack) {
34+
if (Utils.inSkyblock && (SuperSecretSettings.smolPeople || isBreefing(state))){
35+
ms.scale(0.5f, 0.5f, 0.5f)
36+
}
37+
}
38+
}

mod/src/main/resources/mixins.skytils.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"renderer.MixinTileEntityChestRenderer",
6868
"renderer.MixinTileEntitySkullRenderer",
6969
"renderer.MixinWorldRenderer_Glow",
70+
"renderer.MixinPlayerEntityRenderer",
7071
"util.MixinChatStyle",
7172
"util.MixinUtil",
7273
"world.MixinClientWorld",

0 commit comments

Comments
 (0)