-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
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. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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; | ||
} | ||
} |