Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ private boolean spawnParticle(World instance, Entity entity, byte b) {
//#endif
}

@Inject(method = "isBaby", at = @At("HEAD"), cancellable = true)
private void setChildState(CallbackInfoReturnable<Boolean> cir) {
hook.isChild(cir);
}
//#if MC==10809
//$$ @Inject(method = "isBaby", at = @At("HEAD"), cancellable = true)
//$$ private void setChildState(CallbackInfoReturnable<Boolean> cir) {
//$$ hook.isChild(cir);
//$$ }
//#endif

@NotNull
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Skytils - Hypixel Skyblock Quality of Life Mod
* Copyright (C) 2020-2025 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 gg.skytils.skytilsmod.mixins.transformers.renderer;

//#if MC>12000
import gg.skytils.skytilsmod.utils.SuperSecretSettings;
import gg.skytils.skytilsmod.utils.Utils;
import net.minecraft.client.render.entity.PlayerEntityRenderer;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Random;

@Mixin(PlayerEntityRenderer.class)
public class MixinPlayerEntityRenderer {
private static final Random random = new Random();
@Inject(method = "scale(Lnet/minecraft/client/render/entity/state/PlayerEntityRenderState;Lnet/minecraft/client/util/math/MatrixStack;)V", at = @At("HEAD"))
private static void doScale(PlayerEntityRenderState playerEntityRenderState, MatrixStack matrixStack, CallbackInfo ci){
if (isSmol(playerEntityRenderState)){
matrixStack.scale(0.5f, 0.5f, 0.5f);
}
}

private static boolean isSmol(PlayerEntityRenderState state){
boolean isBreefing = state.name.equals("Breefing") && (SuperSecretSettings.breefingDog || random.nextInt(100) < 3);
return Utils.INSTANCE.getInSkyblock() && (SuperSecretSettings.smolPeople || isBreefing);
}
}
//#endif
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,37 @@
*/
package gg.skytils.skytilsmod.mixins.hooks.entity

//#if MC>12000
import gg.skytils.skytilsmod.Skytils
import gg.skytils.skytilsmod.features.impl.dungeons.WitherKingDragons
import gg.skytils.skytilsmod.mixins.transformers.renderer.MixinPlayerEntityRenderer
import gg.skytils.skytilsmod.utils.SuperSecretSettings
import gg.skytils.skytilsmod.utils.Utils
import gg.skytils.skytilsmod.utils.Utils.inSkyblock
import net.minecraft.client.network.ClientPlayerEntity
import net.minecraft.client.render.entity.state.PlayerEntityRenderState
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.entity.effect.StatusEffect
import net.minecraft.particle.ParticleType
import net.minecraft.potion.Potions
import net.minecraft.world.World
import net.minecraft.entity.effect.StatusEffects
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
import java.awt.Color
import kotlin.random.Random

//#if MC>12000
import net.minecraft.entity.effect.StatusEffects
import net.minecraft.particle.ParticleTypes

//#endif

class EntityLivingBaseHook(val entity: LivingEntity) {

var colorMultiplier: Color? = null
var masterDragonType: WitherKingDragons? = null

val isBreefing by lazy {
entity.name.string == "Breefing" && (SuperSecretSettings.breefingDog || Random.nextInt(
100
) < 3)
}

val isSmol by lazy {
Utils.inSkyblock && entity is PlayerEntity && (SuperSecretSettings.smolPeople || isBreefing)
}
//#if MC>12000
//#else
//$$fun isSmol(): Boolean {
//$$ val isBreefing =
//$$ entity.name.string == "Breefing" && (SuperSecretSettings.breefingDog || Random.nextInt(100) < 3)
//$$ return Utils.inSkyblock && (SuperSecretSettings.smolPeople || isBreefing)
//$$}
//#endif

//#if MC>12000
fun modifyPotionActive(statusEffect: StatusEffect, cir: CallbackInfoReturnable<Boolean>) {
Expand Down Expand Up @@ -79,7 +75,10 @@ class EntityLivingBaseHook(val entity: LivingEntity) {
//$$ }
//#endif

fun isChild(cir: CallbackInfoReturnable<Boolean>) {
cir.returnValue = isSmol
}
//#if MC>12000
//#else
//$$fun isChild(cir: CallbackInfoReturnable<Boolean>) {
//$$ cir.returnValue = isSmol()
//$$}
//#endif
}
1 change: 1 addition & 0 deletions mod/src/main/resources/mixins.skytils.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"renderer.MixinTileEntityChestRenderer",
"renderer.MixinTileEntitySkullRenderer",
"renderer.MixinWorldRenderer_Glow",
"renderer.MixinPlayerEntityRenderer",
"util.MixinChatStyle",
"util.MixinUtil",
"world.MixinClientWorld",
Expand Down