diff --git a/NOTICES.md b/NOTICES.md new file mode 100644 index 0000000..a2b3383 --- /dev/null +++ b/NOTICES.md @@ -0,0 +1,8 @@ +# Licenses + +This project is under [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0), but a lot of code taken from other open source projects that are under other licenses that need to be mentioned due to legal reasons. + +| File | License | +| --------------------------------------------------------------------------------------- | ----------------------------------------------------------- | +| [WhoAmI.java](src/main/java/org/saturnclient/saturnclient/mixin/WhoAmI.java) | [MPL-2.0](https://mozilla.org/MPL/2.0/) | +| [Cloaks.java](src/main/java/org/saturnclient/saturnclient/cosmetics/cloaks/Cloaks.java) | [GNU-GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) | diff --git a/README.MD b/README.MD index 95f8c49..dc99514 100644 --- a/README.MD +++ b/README.MD @@ -11,6 +11,7 @@ # Credits - Cloak rendering: `IIpho3nix` & `Dhyan Blum` +- Who Am I: `FokshaWasTaken` - Panton font (ui): `Ivan Petrov` & `Fontfabric` If any of the code or assets are in your name and you want to remove them, please submit an issue, we are still in alpha to have any artists so we would also appreciate if you could help us make some cosmetics diff --git a/src/main/java/org/saturnclient/saturnclient/mixin/WhoAmI.java b/src/main/java/org/saturnclient/saturnclient/mixin/WhoAmI.java new file mode 100644 index 0000000..041e0cf --- /dev/null +++ b/src/main/java/org/saturnclient/saturnclient/mixin/WhoAmI.java @@ -0,0 +1,32 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +/* + * Original code from FokshaWasTaken (GitHub), + * Repository: https://github.com/FokshaWasTaken/who-am-i/ +*/ + +package org.saturnclient.saturnclient.mixin; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import net.minecraft.client.render.entity.LivingEntityRenderer; +import net.minecraft.entity.Entity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(LivingEntityRenderer.class) +public class WhoAmI { + @ModifyExpressionValue(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;getCameraEntity()Lnet/minecraft/entity/Entity;")) + public Entity obfuscateCameraEntity(Entity original) { + // hasLabel checks if the rendered entity is equal to the camera entity (aka our + // player), + // so by setting the camera entity to null in this instance makes the check + // always succeed + // this also allows to keep the other checks in mojang's code, such as checking + // if the hud is enabled etc. + return null; + } +} \ No newline at end of file diff --git a/src/main/resources/saturnclient.mixins.json b/src/main/resources/saturnclient.mixins.json index 1239c11..2e2742b 100644 --- a/src/main/resources/saturnclient.mixins.json +++ b/src/main/resources/saturnclient.mixins.json @@ -7,7 +7,8 @@ "CapeRenderer", "TabListMixin", "NameTagMixin", - "PlayerEntityRendererMixin" + "PlayerEntityRendererMixin", + "WhoAmI" ], "injectors": { "defaultRequire": 1