Skip to content

Commit

Permalink
Merge pull request #7 from Keriils/enhance-capbank
Browse files Browse the repository at this point in the history
enhance EnderIo CapBank & fix bug
  • Loading branch information
Keriils authored Aug 24, 2024
2 parents 6388673 + 956532a commit 4a6a5f3
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
> 即 GregTech_zh_CN.lang 文件
- ✔ 移植类似高版本暴食魔符 -> 暴食指环 以及 饥饿指环(大雾/。。)
- ✔ 移植了高版本的时间瓶 具体看tooltips详细说明
- ✔ 默认修改EnderIo 谐振电容库 与能量注入仪的问题(秒充)
- × 等待新想法中..
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
dependencies {
api("com.github.GTNewHorizons:GT5-Unofficial:5.09.48.66:dev")
implementation("com.github.GTNewHorizons:Draconic-Evolution:1.3.5-GTNH:dev")
implementation("com.github.GTNewHorizons:EnderIO:2.7.6:dev")
implementation("com.github.GTNewHorizons:Botania:1.11.3-GTNH:dev")
implementation('com.github.GTNewHorizons:Avaritia:1.49:dev')
implementation('com.github.GTNewHorizons:Avaritiaddons:1.7.1-GTNH:dev')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static com.xir.NHUtilities.config.Config.enableNumberMultiplierTexture;
import static com.xir.NHUtilities.config.Config.enableTimeAcceleratorBoost;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
Expand Down Expand Up @@ -49,13 +50,15 @@ private void doRender(@NotNull EntityTimeAccelerator entityTimeAccelerator, doub

GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().entityRenderer.disableLightmap(1);

GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
Tessellator tessellator = Tessellator.instance;

drawAllSide(tessellator, x, y, z, angle);

Minecraft.getMinecraft().entityRenderer.enableLightmap(1);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/xir/NHUtilities/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class Config {

// region register mixinModule key region
public static boolean enableEnhancedTeleporterMKII = true;
public static boolean enableModifyEnderIoCapBankIO = true;
public static String[] listeningMods = new String[] { "NHUtilities", "TwistSpaceTechnology", "boxplusplus",
"programmablehatches" };
// endregion
Expand Down Expand Up @@ -133,6 +134,11 @@ static File minecraftHome() {
2,
200,
"accelerate Block Interval");
enableModifyEnderIoCapBankIO = configuration.getBoolean(
"enableModifyEnderIoCapBankIO",
CATEGORY_MIXIN_CONFIG,
enableModifyEnderIoCapBankIO,
"enable Modify EnderIo Cap Bank Max IO");

}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/xir/NHUtilities/mixinPlugin/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public enum Mixins {
DE_TeleporterMKII_Mixin("TeleporterMKII_Mixin", TargetMods.DraconicEvolution, TargetMods.Baubles),
DE_GUITeleporter_Mixin("GUITeleporter_Mixin", TargetMods.DraconicEvolution),
DE_TeleporterPacket_Mixin("TeleporterPacket_Mixin", TargetMods.DraconicEvolution),
GT_MTEAcclerator_Mixin("BaseMetaTileEntity_Mixin", TargetMods.GregTech);
GT_MTEAcclerator_Mixin("BaseMetaTileEntity_Mixin", TargetMods.GregTech),
Modify_CapBankMaxIO_Mixin("Modify_CapBankMaxIO_Mixin", TargetMods.EnderIO);

private final String mixinClass;
private final List<String> targetMod = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static com.xir.NHUtilities.config.Config.enableAccelerateGregTechMachine;
import static com.xir.NHUtilities.config.Config.enableEnhancedTeleporterMKII;
import static com.xir.NHUtilities.config.Config.enableModifyEnderIoCapBankIO;

import java.util.ArrayList;
import java.util.HashSet;
Expand All @@ -14,7 +15,8 @@ public enum MixinsPackage {

EnhanceTeleporterMKII(enableEnhancedTeleporterMKII, "DraconicEvolution", Mixins.DE_TeleporterMKII_Mixin,
Mixins.DE_GUITeleporter_Mixin, Mixins.DE_TeleporterPacket_Mixin),
Enable_MTEAcclerator(enableAccelerateGregTechMachine, "GregTech", Mixins.GT_MTEAcclerator_Mixin);
Enable_MTEAcclerator(enableAccelerateGregTechMachine, "GregTech", Mixins.GT_MTEAcclerator_Mixin),
EnderIO_Modify(enableModifyEnderIoCapBankIO, "EnderIO", Mixins.Modify_CapBankMaxIO_Mixin);

private final Boolean isEnabledModule;
private final Set<String> targetMods = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ public enum TargetMods {

DraconicEvolution("Draconic Evolution", "DraconicEvolution"),
Baubles("Baubles", "Baubles"),
GregTech("GregTech", "gregtech");
GregTech("GregTech", "gregtech"),
EnderIO("Ender IO", "EnderIO");

public final String modName;
public final String modId;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.xir.NHUtilities.mixins.late.EnderIO;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import crazypants.enderio.machine.capbank.BlockItemCapBank;
import crazypants.enderio.machine.capbank.CapBankType;

@Mixin(value = BlockItemCapBank.class, remap = false)
public class Modify_CapBankMaxIO_Mixin {

@Redirect(
method = "receiveEnergy",
at = @At(value = "INVOKE", target = "Lcrazypants/enderio/machine/capbank/CapBankType;getMaxIO()I"),
require = 1)
private int modifyMaxIO(CapBankType instance) {
if (instance == CapBankType.VIBRANT) {
return Integer.MAX_VALUE;
}
return instance.getMaxIO();
}
}

0 comments on commit 4a6a5f3

Please sign in to comment.