Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
I forgot to update newly generated files wtf????????????
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoworange420 committed Nov 15, 2022
1 parent 2b99c17 commit 18e2514
Show file tree
Hide file tree
Showing 21 changed files with 491 additions and 0 deletions.
Binary file added .gradle/4.9/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/4.9/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/4.9/fileHashes/fileHashes.lock
Binary file not shown.
1 change: 1 addition & 0 deletions .gradle/gradle.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This mapping 'snapshot_20180814' was designed for MC 1.12! Use at your own peril.
Empty file.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions src/main/java/com/snoworange/mousse/event/ForgeEventHandeler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.snoworange.mousse.event;

import com.snoworange.mousse.Main;
import com.snoworange.mousse.module.Module;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;

public class ForgeEventHandeler {

@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
for (Module m : Main.moduleManager.modules) {
if (m.isToggled() || m.isEnabled()) {
m.onTick();
}
}
}

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
for (Module m : Main.moduleManager.modules) {

if (m.isToggled() || m.isEnabled()) {
m.onPlayerTick();
}
}
}

@SubscribeEvent
public void onUpdate(LivingEvent.LivingUpdateEvent event) {
for (Module m : Main.moduleManager.modules) {
if ((m.isToggled() || m.isEnabled()) && event.getEntityLiving() instanceof EntityPlayer) {
m.onUpdate();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.snoworange.mousse.mixin.mixins;

import com.snoworange.mousse.Main;
import com.snoworange.mousse.module.modules.misc.TrueDurability;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(value={ItemStack.class})
public abstract class MixinItemStack {
@Shadow
private int itemDamage;

@Inject(method={"<init>(Lnet/minecraft/item/Item;IILnet/minecraft/nbt/NBTTagCompound;)V"}, at={@At(value="RETURN")})
@Dynamic
private void initHook(Item item, int idkWhatDisIsIPastedThis, int dura, NBTTagCompound compound, CallbackInfo info) {
this.itemDamage = this.checkDurability((ItemStack)ItemStack.class.cast(this), this.itemDamage, dura);
}

@Inject(method={"<init>(Lnet/minecraft/nbt/NBTTagCompound;)V"}, at={@At(value="RETURN")})
private void initHook2(NBTTagCompound compound, CallbackInfo info) {
this.itemDamage = this.checkDurability((ItemStack)ItemStack.class.cast(this), this.itemDamage, compound.getShort("Damage"));
}

private int checkDurability(ItemStack item, int damage, int dura) {
int trueDura = damage;
if (Main.moduleManager.getModule("TrueDurability").isToggled() && dura < 0) {
trueDura = dura;
}
return trueDura;
}
}
Loading

0 comments on commit 18e2514

Please sign in to comment.