Skip to content

Commit

Permalink
Merge branch 'dev' into 1.x
Browse files Browse the repository at this point in the history
Signed-off-by: My-Name-Is-Jeff <[email protected]>
  • Loading branch information
My-Name-Is-Jeff authored Aug 9, 2024
2 parents 5da0abd + db6a084 commit 6c19348
Show file tree
Hide file tree
Showing 39 changed files with 1,216 additions and 472 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "hypixel-api"]
path = hypixel-api
url = https://github.com/Skytils/hypixel-api

[submodule "ws-shared"]
path = ws-shared
url = https://github.com/Skytils/ws-shared
9 changes: 7 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ plugins {
signing
}

version = "1.9.8"
version = "1.10.0-pre9"
group = "gg.skytils"

repositories {
mavenLocal()
mavenCentral()
maven("https://repo.sk1er.club/repository/maven-public/")
maven("https://repo.sk1er.club/repository/maven-releases/")
maven("https://repo.hypixel.net/repository/Hypixel/")
maven("https://jitpack.io") {
mavenContent {
includeGroupAndSubgroups("com.github")
Expand Down Expand Up @@ -115,7 +116,7 @@ dependencies {
}

shadowMe(platform(kotlin("bom")))
shadowMe(platform(ktor("bom", "2.3.9", addSuffix = false)))
shadowMe(platform(ktor("bom", "2.3.11", addSuffix = false)))

shadowMe(ktor("serialization-kotlinx-json"))

Expand Down Expand Up @@ -147,11 +148,14 @@ dependencies {

shadowMe(project(":events"))
shadowMe(project(":hypixel-api:types"))
shadowMe(project(":ws-shared"))

shadowMe("org.bouncycastle:bcpg-jdk18on:1.78.1") {
exclude(module = "bcprov-jdk18on")
}
compileOnly("org.bouncycastle:bcprov-jdk18on:1.78.1")
shadowMe("net.hypixel:mod-api:0.4.0")


shadowMe(annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.5")!!)
annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
Expand Down Expand Up @@ -218,6 +222,7 @@ tasks {
relocate("kotlinx.serialization", "gg.skytils.ktx-serialization")
relocate("kotlinx.coroutines", "gg.skytils.ktx-coroutines")
relocate("gg.essential.vigilance", "gg.skytils.vigilance")
relocate("net.hypixel", "gg.skytils.hypixel-net")

exclude(
"**/LICENSE_MixinExtras",
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ pluginManagement {
rootProject.name = "SkytilsMod"
include("events")
include("hypixel-api:types")
include("ws-shared")
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Skytils - Hypixel Skyblock Quality of Life Mod
* Copyright (C) 2020-2024 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.accessors;

import net.hypixel.modapi.HypixelModAPI;
import net.hypixel.modapi.packet.HypixelPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;

import java.util.function.Predicate;

@Mixin(HypixelModAPI.class)
public interface AccessorHypixelModAPI {
@Accessor
Predicate<HypixelPacket> getPacketSender();

@Invoker
void invokeSendRegisterPacket(boolean alwaysSendIfNotEmpty);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Skytils - Hypixel Skyblock Quality of Life Mod
* Copyright (C) 2020-2024 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.accessors;

import net.hypixel.modapi.packet.HypixelPacket;
import net.hypixel.modapi.packet.PacketRegistry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import java.util.Map;

@Mixin(PacketRegistry.class)
public interface AccessorHypixelPacketRegistry {
@Accessor
Map<Class<? extends HypixelPacket>, String> getClassToIdentifier();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package gg.skytils.skytilsmod.mixins.transformers.network;

import gg.skytils.skytilsmod.mixins.hooks.network.NetworkManagerHookKt;
import gg.skytils.skytilsmod.utils.Utils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import net.minecraft.network.EnumPacketDirection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ItemRenderer.class)
public class MixinItemRenderer {
public abstract class MixinItemRenderer {
@Shadow
private ItemStack itemToRender;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public abstract class MixinLayerCape implements LayerRenderer<AbstractClientPlay

@Inject(method = "doRenderLayer(Lnet/minecraft/client/entity/AbstractClientPlayer;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;pushMatrix()V", shift = At.Shift.AFTER))
private void scaleChild(AbstractClientPlayer entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, CallbackInfo ci) {
if (this.playerRenderer.getMainModel().isChild) {
if (this.playerRenderer.getMainModel().isChild || entity.isChild()) {
GlStateManager.scale(0.5, 0.5, 0.5);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@

package gg.skytils.skytilsmod.mixins.transformers.renderer;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import gg.skytils.skytilsmod.mixins.hooks.renderer.LayerCustomHeadHookKt;
import net.minecraft.client.renderer.entity.layers.LayerCustomHead;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -30,6 +33,11 @@
@Mixin(LayerCustomHead.class)
public abstract class MixinLayerCustomHead implements LayerRenderer<EntityLivingBase> {

@WrapOperation(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;isSneaking()Z"))
private boolean disableSneakOffset(EntityLivingBase instance, Operation<Boolean> original) {
return (!(instance instanceof EntityPlayer) || !instance.isChild()) && original.call(instance);
}

@Inject(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;color(FFFF)V", shift = At.Shift.AFTER), cancellable = true)
private void renderCustomHeadLayer(EntityLivingBase entity, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale, CallbackInfo ci) {
LayerCustomHeadHookKt.renderCustomHeadLayer(entity, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, ci);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Skytils - Hypixel Skyblock Quality of Life Mod
* Copyright (C) 2020-2024 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;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ModelBiped.class)
public abstract class MixinModelBiped extends ModelBase {
@Shadow public ModelRenderer bipedHeadwear;

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;popMatrix()V", ordinal = 0))
private void renderChildHeadPost(Entity entityIn, float f, float g, float h, float i, float j, float scale, CallbackInfo ci) {
if (this.isChild && entityIn instanceof EntityPlayer) {
this.bipedHeadwear.render(scale);
}
}

@WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelRenderer;render(F)V", ordinal = 6))
private boolean renderChildHeadwear(ModelRenderer instance, float j, @Local(argsOnly = true) Entity entityIn) {
return !this.isChild || !(entityIn instanceof EntityPlayer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(RenderManager.class)
public class MixinRenderManager {
public abstract class MixinRenderManager {
@Inject(method = "shouldRender", at = @At("HEAD"), cancellable = true)
private void shouldRender(Entity entityIn, ICamera camera, double camX, double camY, double camZ, CallbackInfoReturnable<Boolean> cir) {
RenderManagerHookKt.shouldRender(entityIn, camera, camX, camY, camZ, cir);
Expand Down
Loading

0 comments on commit 6c19348

Please sign in to comment.