Skip to content

Commit

Permalink
yazyu renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Apr 6, 2024
1 parent 3feceba commit 7ee8d5d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
22 changes: 20 additions & 2 deletions src/main/java/net/aspw/client/Launch.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.aspw.client

import com.viaversion.viaversion.api.protocol.version.ProtocolVersion
import net.aspw.client.config.FileManager
import net.aspw.client.event.ClientShutdownEvent
import net.aspw.client.event.EventManager
Expand All @@ -24,15 +25,16 @@ import net.aspw.client.utils.ClassUtils.hasForge
import net.aspw.client.utils.misc.sound.TipSoundManager
import net.aspw.client.visual.client.clickgui.dropdown.ClickGui
import net.aspw.client.visual.font.semi.Fonts
import net.raphimc.vialoader.util.ProtocolVersionList

object Launch {

// Client information
const val CLIENT_BEST = "NightX"
const val CLIENT_FOLDER = "NightX-Client"
const val CLIENT_VERSION = "B104"
const val CLIENT_VERSION = "B105"
const val CLIENT_CHAT = "§c$CLIENT_BEST: §r"
const val CLIENT_PROTOCOL_RANGE = "1.8 to 1.20.5"
const val CLIENT_PROTOCOL_RANGE = "1.8 to 1.20.4"

var isStarting = false

Expand All @@ -55,17 +57,33 @@ object Launch {
// Discord RPC
lateinit var discordRPC: DiscordRPC

// ViaVersion
var versions = mutableListOf<ProtocolVersion>()

/**
* Execute if client will be started
*/
fun startClient() {
isStarting = true

ClientUtils.getLogger().info("Launching...")

lastTick = System.currentTimeMillis()

ProtocolBase.init(ProtocolMod.PLATFORM)

versions.addAll(ProtocolVersionList.getProtocolsNewToOld())

try {
for (i in versions) {
if (i == ProtocolVersion.unknown || i == ProtocolVersion.v1_20_5) {
versions.remove(i)
ClientUtils.getLogger().info("Removed Unknown Protocols ($i)")
}
}
} catch (_: Exception) {
}

// Check update
APIConnecter.checkStaffList()
APIConnecter.checkStatus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class SilentRotations : Module() {
if (mc.thePlayer == null || RotationUtils.targetRotation == null) {
if (rotating)
rotating = false
mc.thePlayer.prevRotationYaw = RotationUtils.prevCameraYaw
mc.thePlayer.prevRotationPitch = RotationUtils.prevCameraPitch
mc.thePlayer.rotationYaw = RotationUtils.cameraYaw
mc.thePlayer.rotationPitch = RotationUtils.cameraPitch
return
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/net/aspw/client/protocol/ProtocolBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public static void init(final VFPlatform platform) {
return;
}

final ProtocolVersion version = ProtocolVersion.getProtocol(platform.getGameVersion());

if (version == ProtocolVersion.unknown)
throw new IllegalArgumentException("Unknown Version " + platform.getGameVersion());

manager = new ProtocolBase();

ViaLoader.init(new ViaVersionPlatformImpl(null), new ProtocolVLLoader(platform), new ProtocolVLInjector(), null, ViaBackwardsPlatformImpl::new, ViaRewindPlatformImpl::new, null, null);
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/net/aspw/client/protocol/ProtocolMod.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package net.aspw.client.protocol;

import net.aspw.client.protocol.api.VFPlatform;
import net.minecraft.realms.RealmsSharedConstants;
import net.minecraftforge.fml.common.Mod;

@Mod(modid = "NightX", version = "Release")
public class ProtocolMod implements VFPlatform {

public static final ProtocolMod PLATFORM = new ProtocolMod();

@Override
public int getGameVersion() {
return RealmsSharedConstants.NETWORK_PROTOCOL_VERSION;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import com.mojang.realmsclient.gui.ChatFormatting;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.aspw.client.Launch;
import net.aspw.client.protocol.ProtocolBase;
import net.aspw.client.visual.font.smooth.FontLoaders;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlot;
import net.raphimc.vialoader.util.ProtocolVersionList;
import org.lwjgl.input.Keyboard;

import java.io.IOException;
Expand Down Expand Up @@ -75,12 +75,12 @@ public SlotList(Minecraft client, int width, int height, int top, int bottom, in

@Override
protected int getSize() {
return ProtocolVersionList.getProtocolsNewToOld().size() - 2;
return Launch.INSTANCE.getVersions().size() - 2;
}

@Override
protected void elementClicked(int index, boolean b, int i1, int i2) {
finishedCallback.finished(ProtocolVersionList.getProtocolsNewToOld().get(index), parent);
finishedCallback.finished(Launch.INSTANCE.getVersions().get(index), parent);
}

@Override
Expand All @@ -96,7 +96,7 @@ protected void drawBackground() {
@Override
protected void drawSlot(int index, int x, int y, int slotHeight, int mouseX, int mouseY) {
final ProtocolVersion targetVersion = ProtocolBase.getManager().getTargetVersion();
final ProtocolVersion version = ProtocolVersionList.getProtocolsNewToOld().get(index);
final ProtocolVersion version = Launch.INSTANCE.getVersions().get(index);

String color;
if (targetVersion == version) {
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/net/aspw/client/protocol/api/VFPlatform.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
package net.aspw.client.protocol.api;

/**
* This interface is used to access platform specific fields.
*/
public interface VFPlatform {

/**
* @return the native version of the platform
*/
int getGameVersion();
}
Binary file modified src/main/resources/assets/minecraft/client/cape/nightx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7ee8d5d

Please sign in to comment.