mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-21 04:22:25 +00:00
- Hacky Hacky He He #2
This commit is contained in:
1 parent
aa96cd4db9
commit
5100b89546
2 files changed
+15
-11
No files matched your search
@@ -1,39 +1,30 @@
|
||||
package makeo.gadomancy.common.events;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import makeo.gadomancy.common.aura.AuraResearchManager;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileAuraPylon;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileBlockProtector;
|
||||
import makeo.gadomancy.common.data.ModConfig;
|
||||
import makeo.gadomancy.common.entities.EntityAuraCore;
|
||||
import makeo.gadomancy.common.entities.EntityPermNoClipItem;
|
||||
import makeo.gadomancy.common.familiar.FamiliarAIController;
|
||||
import makeo.gadomancy.common.items.ItemAuraCore;
|
||||
import makeo.gadomancy.common.utils.world.TCMazeHandler;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import thaumcraft.common.items.armor.Hover;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
@@ -52,7 +43,11 @@ public class EventHandlerEntity {
|
||||
}*/
|
||||
|
||||
public static int onGetFortuneLevel(EntityLivingBase entity) {
|
||||
return EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, entity.getHeldItem());
|
||||
return 400;
|
||||
}
|
||||
|
||||
public static int onGetEnchantmentLevel(int enchantmentId, ItemStack stack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -2,7 +2,7 @@ package makeo.gadomancy.coremod;
|
||||
|
||||
import cpw.mods.fml.common.asm.transformers.AccessTransformer;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
@@ -43,6 +43,15 @@ public class GadomancyTransformer extends AccessTransformer {
|
||||
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "makeo/gadomancy/common/events/EventHandlerEntity",
|
||||
"onGetFortuneLevel", "(Lnet/minecraft/entity/EntityLivingBase;)I", false));
|
||||
mn.instructions.add(new InsnNode(Opcodes.IRETURN));
|
||||
|
||||
} else if(mn.name.equals("getEnchantmentLevel") || mn.name.equals("func_77506_a")) {
|
||||
mn.instructions = new InsnList();
|
||||
|
||||
mn.instructions.add(new VarInsnNode(Opcodes.ILOAD, 0));
|
||||
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
|
||||
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "makeo/gadomancy/common/events/EventHandlerEntity",
|
||||
"onGetEnchantmentLevel", "(ILnet/minecraft/item/ItemStack;)I", false));
|
||||
mn.instructions.add(new InsnNode(Opcodes.IRETURN));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user