Skip to content

Commit

Permalink
Improve Dev Wings and Scale
Browse files Browse the repository at this point in the history
  • Loading branch information
Cezqr committed Dec 31, 2024
1 parent 7e33127 commit 2c2e006
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 9 deletions.
15 changes: 15 additions & 0 deletions odin/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<!-- Filter out Hypixel scoreboard and sound errors -->
<RegexFilter regex="Error executing task.*|Unable to play unknown soundEvent.*" onMatch="DENY" onMismatch="NEUTRAL"/>

<!-- Filter out any 'Unable to determine registrant mod' errors related to 'me.odin' -->
<RegexFilter regex="Unable to determine registrant mod for me\.odin.*" onMatch="DENY" onMismatch="NEUTRAL"/>

<Loggers>
<!-- Set the logger level for FML to WARN to hide INFO and ERROR messages -->
<Logger level="WARN" name="FML"/>
<!-- Preserve logging for net.minecraft.util.MessageDeserializer -->
<Logger level="INFO" name="net.minecraft.util.MessageDeserializer"/>
</Loggers>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Pseudo
@Mixin(targets = "gg.skytils.skytilsmod.features.impl.misc.Funny")
@Mixin(targets = "gg.skytils.skytilsmod.features.impl.misc.Funny", remap = false)
public class MixinSkytilsFunny {
@Dynamic
@Inject(method = "joinedSkyblock", at = @At("HEAD"), cancellable = true)
Expand Down
15 changes: 15 additions & 0 deletions odinclient/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<!-- Filter out Hypixel scoreboard and sound errors -->
<RegexFilter regex="Error executing task.*|Unable to play unknown soundEvent.*" onMatch="DENY" onMismatch="NEUTRAL"/>

<!-- Filter out any 'Unable to determine registrant mod' errors related to 'me.odin' -->
<RegexFilter regex="Unable to determine registrant mod for me\.odin.*" onMatch="DENY" onMismatch="NEUTRAL"/>

<Loggers>
<!-- Set the logger level for FML to WARN to hide INFO and ERROR messages -->
<Logger level="WARN" name="FML"/>
<!-- Preserve logging for net.minecraft.util.MessageDeserializer -->
<Logger level="INFO" name="net.minecraft.util.MessageDeserializer"/>
</Loggers>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Pseudo
@Mixin(targets = "gg.skytils.skytilsmod.features.impl.misc.Funny")
@Mixin(targets = "gg.skytils.skytilsmod.features.impl.misc.Funny", remap = false)
public class MixinSkytilsFunny {
@Dynamic
@Inject(method = "joinedSkyblock", at = @At("HEAD"), cancellable = true)
Expand Down
16 changes: 9 additions & 7 deletions src/main/kotlin/me/odinmain/features/impl/render/DevPlayers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import me.odinmain.features.impl.render.ClickGUIModule.devSize
import me.odinmain.utils.downloadFile
import me.odinmain.utils.getDataFromServer
import me.odinmain.utils.render.Color
import me.odinmain.utils.render.translate
import net.minecraft.client.entity.AbstractClientPlayer
import net.minecraft.client.model.ModelBase
import net.minecraft.client.model.ModelRenderer
Expand Down Expand Up @@ -96,8 +95,8 @@ object DevPlayers {
if (!devs.containsKey(entityLivingBaseIn.name)) return
if (!devSize && entityLivingBaseIn.name == mc.thePlayer.name) return
val dev = devs[entityLivingBaseIn.name] ?: return
if (dev.yScale < 0) GlStateManager.translate(0f, dev.yScale * 2, 0f)
GlStateManager.scale(dev.xScale, dev.yScale, dev.zScale)
if (dev.yScale < 0) GlStateManager.translate(0f, dev.yScale * -2, 0f)
}

@SubscribeEvent
Expand Down Expand Up @@ -141,23 +140,26 @@ object DevPlayers {
val x = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks
val y = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks
val z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks
if (dev.yScale < 0) translate(0f, dev.yScale * -2, 0f)
if (dev.yScale < 0) GlStateManager.translate(0f, dev.yScale * -2, 0f)

GlStateManager.translate(-mc.renderManager.viewerPosX + x, -mc.renderManager.viewerPosY + y, -mc.renderManager.viewerPosZ + z)
GlStateManager.scale(-0.2 * dev.xScale, -0.2 * dev.yScale, 0.2 * dev.zScale)
GlStateManager.scale(-0.2, -0.2, 0.2)
GlStateManager.scale(dev.xScale, dev.yScale, dev.zScale)
GlStateManager.rotate(180 + rotation, 0f, 1f, 0f)
GlStateManager.translate(0.0, -(1.25 / 0.2f), 0.0)
GlStateManager.translate(0.0, 0.0, 0.1 / 0.2 / dev.zScale)
GlStateManager.translate(0.0, 0.0, 0.25)

if (player.isSneaking) {
GlStateManager.translate(0.0, (0.125 / 1.0) * dev.yScale, 0.0)
GlStateManager.rotate(45f, 1f, 0f, 0f)
GlStateManager.translate(0.0, 1.0, -0.5)
}

GlStateManager.color(dev.wingsColor.r.toFloat()/255, dev.wingsColor.g.toFloat()/255, dev.wingsColor.b.toFloat()/255, 1f)
mc.textureManager.bindTexture(dragonWingTextureLocation)

for (j in 0..1) {
GlStateManager.enableCull()
GlStateManager.rotate(20f, 0f, 1f, 0f)
val f11 = System.currentTimeMillis() % 1000 / 1000f * Math.PI.toFloat() * 2.0f
wing.rotateAngleX = Math.toRadians(-80.0).toFloat() - cos(f11) * 0.2f
wing.rotateAngleY = Math.toRadians(20.0).toFloat() + sin(f11) * 0.4f
Expand All @@ -166,6 +168,7 @@ object DevPlayers {
wing.render(0.0625f)
GlStateManager.scale(-1.0f, 1.0f, 1.0f)
if (j == 0) {
GlStateManager.rotate(20f, 0f, 1f, 0f)
GlStateManager.cullFace(1028)
}
}
Expand Down Expand Up @@ -205,7 +208,6 @@ object DevPlayers {
synchronized(capeUpdateCache) {
if (capeUpdateCache[fileName] != true) {
if (!capeFile.exists() || !isFileUpToDate(capeUrl, capeFile)) {
println("Downloading cape: $fileName")
downloadFile(capeUrl, capeFile.path)
}
capeUpdateCache[fileName] = true
Expand Down

0 comments on commit 2c2e006

Please sign in to comment.