diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-11 15:30:20 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-11 15:30:20 +0800 |
commit | 9e7bedbd8bedd5599a756cce9cad76754f9a2e74 (patch) | |
tree | e78d23b5e52859c029118d647511345a8fb0d1e2 /features/cosmetics/dragonWings.js | |
parent | cd85af68f5af559d869097306cf063a628b19f6f (diff) | |
download | SoopyV2-9e7bedbd8bedd5599a756cce9cad76754f9a2e74.tar.gz SoopyV2-9e7bedbd8bedd5599a756cce9cad76754f9a2e74.tar.bz2 SoopyV2-9e7bedbd8bedd5599a756cce9cad76754f9a2e74.zip |
Fixes to many things
Diffstat (limited to 'features/cosmetics/dragonWings.js')
-rw-r--r-- | features/cosmetics/dragonWings.js | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/features/cosmetics/dragonWings.js b/features/cosmetics/dragonWings.js index d9e8a1c..d523a46 100644 --- a/features/cosmetics/dragonWings.js +++ b/features/cosmetics/dragonWings.js @@ -4,6 +4,8 @@ const ModelDragon = Java.type("net.minecraft.client.model.ModelDragon") const ResourceLocation = Java.type("net.minecraft.util.ResourceLocation") const GlStateManager = Java.type("net.minecraft.client.renderer.GlStateManager"); +const Essential = Java.type("gg.essential.Essential") +const EssentialCosmeticSlot = Java.type("gg.essential.cosmetics.CosmeticSlot") const FACING = Java.type("net.minecraft.block.BlockDirectional").field_176387_N let dragon = new ModelDragon(0) //too lazy to make my own model so i just yoink it from modelDragon lmfao @@ -24,10 +26,6 @@ class DragonWings extends Cosmetic { } onRender(ticks){ - if(this.settings.disableWithNoChestplate && this.player.getPlayer().func_82169_q(2) === null && !(this.player === Player && Client.getMinecraft().field_71474_y.field_74320_O === 0)){ - return - } - if(this.player.getPlayer().func_98034_c(Player.getPlayer())){ return } @@ -157,7 +155,7 @@ class DragonWings extends Cosmetic { let dist = Math.sqrt((Player.getX()-this.player.getX())**2+(Player.getY()-this.player.getY())**2+(Player.getZ()-this.player.getZ())**2)+1 - World.playSound("mob.enderdragon.wings", (this.settings.scale*15)*Math.min(1, 50/(dist*dist)), 1) + World.playSound("mob.enderdragon.wings", (Math.max(0.005,this.settings.scale-0.005)*25)*Math.min(1, 50/Math.min(1,dist*dist))/50, 1-(Math.max(0.005,this.settings.scale-0.005)*25)) this.lastFlapSound = 2*Math.PI+(this.animOffset)-this.animOffset%(Math.PI*2) } this.animOffset += 2*timeSince*Math.min(1,(amt/(1*Math.PI))*2) @@ -261,20 +259,34 @@ class DragonWings extends Cosmetic { wingTip.field_78808_h = -((Math.sin((this.animOffset))*0.5 + 0.3)) } - Tessellator.translate(0.1, 0, 0) - wing.func_78791_b(this.settings.scale) //render left wing + Tessellator.scale(this.settings.scale, this.settings.scale, this.settings.scale) + wing.func_78791_b(1) //render left wing - Tessellator.translate(-0.2, 0, 0) + Tessellator.translate(-0.2/this.settings.scale, 0, 0) Tessellator.scale(-1, 1, 1) - wing.func_78791_b(this.settings.scale) //render right wing + wing.func_78791_b(1) //render right wing GlStateManager.func_179121_F(); // popMatrix } onTick(){ - // this.scale += 0.001 + if(!this.player.getPlayer().getEssentialCosmetics()) return + + let wingCosmetic = this.player.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.WINGS) + if(wingCosmetic !== null){ + this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic)).getModel().getModel().boneList.forEach(b=>{ + b.isHidden = true + }) + }else{ + let fullBodyCosmetic = this.player.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.FULL_BODY) + if(fullBodyCosmetic === "DRAGON_ONESIE_2"){ + this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic)).getModel().getModel().boneList.forEach(b=>{ + if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1")b.isHidden = true + }) + } + } } } |