Skip to content

Commit

Permalink
3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Cephetir committed Nov 26, 2022
1 parent 1cf9f77 commit a6de626
Show file tree
Hide file tree
Showing 119 changed files with 2,753 additions and 3,264 deletions.
51 changes: 30 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,22 @@ import dev.architectury.pack200.java.Pack200Adapter
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.7.21"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("gg.essential.loom") version "0.10.0.+"
id("io.github.juuxel.loom-quiltflower-mini") version "7d04f32023"
id("dev.architectury.architectury-pack200") version "0.1.3"
java
idea
}

version = "3.3"
version = "3.4"
group = "me.cephetir"

base {
archivesName.set("SkySkipped")
}

repositories {
mavenLocal()
mavenCentral()
maven("https://repo.sk1er.club/repository/maven-public/")
maven("https://repo.sk1er.club/repository/maven-releases/")
maven("https://jitpack.io")
}

loom {
silentMojangMappingsLicense()
launchConfigs {
Expand All @@ -51,7 +44,7 @@ loom {
property("legacy.debugClassLoading", "true")
property("legacy.debugClassLoadingSave", "true")
property("legacy.debugClassLoadingFiner", "true")
arg("--tweakClass", "gg.essential.loader.stage0.EssentialSetupTweaker")
arg("--tweakClass", "me.cephetir.bladecore.loader.BladeCoreTweaker")
arg("--mixin", "mixins.sm.json")
}
}
Expand All @@ -74,26 +67,26 @@ val include: Configuration by configurations.creating {
configurations.implementation.get().extendsFrom(this)
}

repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.ilarea.ru/snapshots")
}

dependencies {
minecraft("com.mojang:minecraft:1.8.9")
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9")
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9")

include("gg.essential:loader-launchwrapper:1.1.3")
implementation("gg.essential:essential-1.8.9-forge:3760")

include("com.github.jagrosh:DiscordIPC:18b6096") {
exclude(module = "log4j")
}
include("me.cephetir:bladecore-loader-1.8.9-forge:1.1")
implementation("me.cephetir:bladecore-1.8.9-forge:0.0.1-beta5.5")

implementation("com.github.DV8FromTheWorld:JDA:v5.0.0-alpha.17") {
implementation("com.github.DV8FromTheWorld:JDA:v5.0.0-alpha.19") {
exclude(module = "opus-java")
}

annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
compileOnly("org.spongepowered:mixin:0.8.5")

implementation(files("libs/Pizza_Client-1.1.3-pre1.jar", "libs/ChromaHUD-3.0.jar"))
}

sourceSets {
Expand Down Expand Up @@ -122,7 +115,7 @@ tasks {
"ForceLoadAsMod" to true,
"ModSide" to "CLIENT",
"ModType" to "FML",
"TweakClass" to "gg.essential.loader.stage0.EssentialSetupTweaker",
"TweakClass" to "me.cephetir.bladecore.loader.BladeCoreTweaker",
"TweakOrder" to "0",
"MixinConfigs" to "mixins.sm.json"
)
Expand Down Expand Up @@ -166,7 +159,23 @@ tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.7"

freeCompilerArgs =
listOf(
"-Xjvm-default=all",
"-Xbackend-threads=0",
"-Xuse-k2"
)
}
kotlinDaemonJvmArguments.set(
listOf(
"-Xmx2G",
"-Dkotlin.enableCacheBuilding=true",
"-Dkotlin.useParallelTasks=true",
"-Dkotlin.enableFastIncremental=true"
)
)
}
}

Expand Down
Binary file removed libs/ChromaHUD-3.0.jar
Binary file not shown.
Binary file removed libs/Pizza_Client-1.1.3-pre1.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ pluginManagement {
maven("https://maven.architectury.dev/")
maven("https://maven.fabricmc.net")
maven("https://maven.minecraftforge.net/")
maven("https://repo.sk1er.club/repository/maven-releases/")
maven("https://maven.ilarea.ru/snapshots")
maven("https://jitpack.io")
}
resolutionStrategy {
eachPlugin {
when (requested.id.id) {
"net.minecraftforge.gradle.forge" -> useModule("com.github.asbyth:ForgeGradle:${requested.version}")
"io.github.juuxel.loom-quiltflower-mini" -> useModule("com.github.Cephetir:loom-quiltflower-mini:${requested.version}")
}
}
}
Expand Down

This file was deleted.

47 changes: 47 additions & 0 deletions src/main/java/me/cephetir/skyskipped/mixins/MixinBlockCarpet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2022 Cephetir
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
* as the name is changed.
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
*
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*/

package me.cephetir.skyskipped.mixins;

import me.cephetir.skyskipped.config.Config;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCarpet;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(BlockCarpet.class)
public class MixinBlockCarpet extends Block {

public MixinBlockCarpet(Material p_i46399_1_, MapColor p_i46399_2_) {
super(p_i46399_1_, p_i46399_2_);
}

public MixinBlockCarpet(Material materialIn) {
super(materialIn);
}

@Inject(method = "setBlockBoundsFromMeta", at = @At(value = "HEAD"), cancellable = true)
public void setBlockBoundsFromMeta(int meta, CallbackInfo ci) {
if (!Config.Companion.getRemoveCarpets()) return;
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f);
ci.cancel();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@

package me.cephetir.skyskipped.mixins;

import org.spongepowered.asm.mixin.Dynamic;
import me.cephetir.skyskipped.SkySkipped;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Pseudo
@Mixin(targets = "club.sk1er.patcher.hooks.FontRendererHook", remap = false)
public class MixinPatcherFontRendererHook {
@Dynamic
@Inject(method = "renderStringAtPos", at = @At("HEAD"), cancellable = true)
private void overridePatcherFontRendererHook(String text, boolean shadow, CallbackInfoReturnable<Boolean> ci) {
if (text.contains("§#"))
ci.cancel();
@Mixin(value = EntityPlayer.class, remap = false)
public class MixinEntityPlayer {
@Inject(method = "getDisplayNameString", at=@At("RETURN"), cancellable = true)
private void getDisplayNameString(CallbackInfoReturnable<String> cir) {
cir.setReturnValue(SkySkipped.getCosmetics(cir.getReturnValue()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2022 Cephetir
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
* as the name is changed.
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
*
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*/

package me.cephetir.skyskipped.mixins;

import me.cephetir.skyskipped.config.Config;
import net.minecraft.client.gui.GuiScreen;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.lang.reflect.Field;

@Pseudo
@Mixin(targets = "io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay", remap = false)
public class MixinEquipmentOverlay {
@Unique
private Class<?> petOverlayClass = null;
@Unique
private Object petOverlayInstance = null;
@Unique
private Class<?> customArmourClass = null;
@Unique
private Object customArmourInstance = null;

@Dynamic
@Inject(method = "updateGuiInfo", at = @At("HEAD"), cancellable = true)
private void updateGuiInfo(GuiScreen screen, CallbackInfo ci) {
if (!Config.Companion.getNeuOptimize()) return;
try {
if (petOverlayInstance == null || customArmourInstance == null) {
Class<?> neu = Class.forName("io.github.moulberry.notenoughupdates.NotEnoughUpdates");
Field neuInstanceField = getField(neu, "INSTANCE");
Object neuInstance = neuInstanceField.get(null);

Field configField = getField(neu, "config");
Class<?> config = configField.getType();
Object configInstance = configField.get(neuInstance);

Field petOverlayField = getField(config, "petOverlay");
petOverlayClass = petOverlayField.getType();
petOverlayInstance = petOverlayField.get(configInstance);

Field customArmourField = getField(config, "customArmour");
customArmourClass = customArmourField.getType();
customArmourInstance = customArmourField.get(configInstance);
}

Field petInvDisplayField = getField(petOverlayClass, "petInvDisplay");
boolean petInvDisplay = petInvDisplayField.getBoolean(petOverlayInstance);

Field enableArmourHudField = getField(customArmourClass, "enableArmourHud");
boolean enableArmourHud = enableArmourHudField.getBoolean(customArmourInstance);

if (!petInvDisplay && !enableArmourHud)
ci.cancel();
} catch (ClassNotFoundException | IllegalAccessException e) {
e.printStackTrace();
}
}

@Unique
private Field getField(Class<?> clazz, String name) {
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields)
if (field.getName().equals(name))
return field;
return null;
}
}
Loading

0 comments on commit a6de626

Please sign in to comment.