Skip to content

Commit

Permalink
Pushed final commits for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
ByThePowerOfScience committed Sep 23, 2023
1 parent ff42592 commit cb324de
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion To-Do List.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Optimizations DONE:
-Fix: change order of checks



-configanytime for thaumcraft jankconfig

-Mob Grinding Utils
-Fix: Ender inhibitor not working consistently
Expand Down
24 changes: 12 additions & 12 deletions mod/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,27 @@ dependencies {
implementation("mezz.jei:jei_1.12.2:4.16.1.302")

deobfCompile("curse.maven:ActuallyAdditions-228404:3117927")
// deobfProvided("curse.maven:DraconicEvolution-223565:3431261")
// deobfProvided(
// "curse.maven:EnderIO-64578:3328811",
// "curse.maven:ProjectIntelligence-306028:2833640",
// "curse.maven:EnderCore-231868:2972849",
// "curse.maven:BrandonsCore-231382:3408276",
// "curse.maven:CodeChickenLib-242818:2779848"
// )
// compile "cofh:RedstoneFlux:1.12-2.0.0.1:universal"

deobfCompile("curse.maven:Erebus-220698:3211974")
deobfProvided("curse.maven:Erebus-220698:3211974")

// **CRAFTTWEAKER HOOKS**
deobfCompile(
"curse.maven:Patchouli-306770:3162874",
"curse.maven:Baubles-227083:2518667"
)

deobfCompile("curse.maven:Botania-225643:3330934")
deobfProvided("curse.maven:Botania-225643:3330934")

deobfCompile("curse.maven:ExtraUtils2-225561:2678374")
deobfProvided("curse.maven:ExtraUtils2-225561:2678374")


deobfProvided(
Expand Down Expand Up @@ -102,15 +111,6 @@ dependencies {
"curse.maven:MTLib-253211:3308160"
)


// deobfProvided(
// "curse.maven:EnderIO-64578:3328811",
// "curse.maven:ProjectIntelligence-306028:2833640",
// "curse.maven:EnderCore-231868:2972849",
// "curse.maven:BrandonsCore-231382:3408276",
// "curse.maven:CodeChickenLib-242818:2779848"
// )
// compile "cofh:RedstoneFlux:1.12-2.0.0.1:universal"

deobfProvided("curse.maven:AppleSkin-248787:2987247")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraftforge.client.GuiIngameForge;
import btpos.dj2addons.custom.impl.StatusEffects;
import org.spongepowered.asm.mixin.Mixin;
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.Redirect;
Expand All @@ -24,26 +25,26 @@ public MSatuRegen(Minecraft mcIn) {
super(mcIn);
}

private int regen = -1;
private int i = -1;
@Unique private int dj2addons$regen = -1;
@Unique private int dj2addons$renderIterator = -1;

@Inject(method= "renderFood(II)V", locals= LocalCapture.CAPTURE_FAILSOFT, at=@At(target = "Lnet/minecraft/client/renderer/GlStateManager;enableBlend()V", value="INVOKE"))
private void getRegenValue(int width, int height, CallbackInfo ci, EntityPlayer player) {
regen = -1;
dj2addons$regen = -1;
if (player.isPotionActive(StatusEffects.UIEffectTrigger_HungerShankWave.apply(null)))
{
regen = updateCounter % 25;
dj2addons$regen = updateCounter % 25;
}
}

@Inject(method= "renderFood(II)V", locals=LocalCapture.CAPTURE_FAILSOFT, at=@At(target = "net/minecraftforge/client/GuiIngameForge.drawTexturedModalRect (IIIIII)V", value="INVOKE", ordinal = 0, shift=BEFORE))
private void getIteratorIndex(int width, int height, CallbackInfo ci, EntityPlayer player, int left, int top, boolean unused, FoodStats stats, int level, int i, int idx, int x, int y) {
this.i = i;
this.dj2addons$renderIterator = i;
}

@Redirect(method= "renderFood(II)V", at=@At(target = "net/minecraftforge/client/GuiIngameForge.drawTexturedModalRect (IIIIII)V", value="INVOKE"))
private void regenEffect(GuiIngameForge instance, int x, int y, int textureX, int textureY, int width, int height) {
if (i == regen)
if (dj2addons$renderIterator == dj2addons$regen)
y -= 2;
instance.drawTexturedModalRect(x, y, textureX, textureY, width, height);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
* Fixes this method creating 1000 new itemstacks every tick for LITERALLY NO REASON
*/
@Mixin(AbilityAccessories.class)
public abstract class MAbilityAccessories {
@Unique private static final Map<Item, ItemStack> dj2addons$itemstackCache = new HashMap<>();
@Unique private static final Map<Item, ItemStack> dj2addons$itemstackCache = new ConcurrentHashMap<>();

@Redirect(
remap=false,
Expand All @@ -25,7 +25,7 @@ public abstract class MAbilityAccessories {
value="NEW",
target="(Lnet/minecraft/item/Item;)net/minecraft/item/ItemStack"
)
)
) // not necessarily the most optimal, but it's less brittle than directly referencing each one.
private ItemStack cacheResult(Item itemIn) {
return dj2addons$itemstackCache.computeIfAbsent(itemIn, ItemStack::new);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
Expand All @@ -11,7 +12,7 @@

@Mixin(MiscUtil.class)
public abstract class MMiscUtil {
private static NBTTagCompound tagcompound;
@Unique private static NBTTagCompound dj2addons$tagcompound;

@ModifyVariable(
remap=false,
Expand All @@ -28,7 +29,7 @@ public abstract class MMiscUtil {
)
)
private static NBTTagCompound getNBTCompound(NBTTagCompound nbt) {
tagcompound = nbt;
dj2addons$tagcompound = nbt;
return nbt;
}

Expand All @@ -54,7 +55,7 @@ private static NBTTagCompound getNBTCompound(NBTTagCompound nbt) {
private static Object addTagCompound(Object stack) {
if (stack instanceof ItemStack) {
ItemStack is = ((ItemStack)stack);
is.setTagCompound(tagcompound);
is.setTagCompound(dj2addons$tagcompound);
return is;
} else {
return stack;
Expand Down

0 comments on commit cb324de

Please sign in to comment.