Jump to content

darkevilmac

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by darkevilmac

  1. So recently I've been trying to make it so mobs don't attack specific players. For some reason my code works on almost all mobs but not Spiders and Slimes. Would anyone have an idea as to why this isn't working the way I need it to? package darkevilmac.karma.effect import java.util.ArrayList import cpw.mods.fml.common.eventhandler.SubscribeEvent import cpw.mods.fml.relauncher.Side import darkevilmac.karma.tools.KarmaUtils import net.minecraft.entity.player.EntityPlayer import net.minecraft.entity.{EntityCreature, EntityLiving} import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent /** * Created by Darkevilmac on 6/25/2014. */ class MobIgnoreEffect extends KarmaEffect { var playersToCheck: ArrayList[string] = new ArrayList[string]() def init(player: String, side: Side) { if (!playersToCheck.contains(player)) { playersToCheck.add(player) } } def onUpdate(player: EntityPlayer, side: Side) { } def finish(player: String, side: Side) { var i: Int = 0 while (i < playersToCheck.size()) { if (playersToCheck.get(i) == player) { playersToCheck.remove(i) return } i = i + 1; } } def shouldContinue(player: EntityPlayer, side: Side): Boolean = { return KarmaUtils.getPlayerKarma(player) >= 950 } def canApply(player: EntityPlayer): Boolean = { return KarmaUtils.getPlayerKarma(player) >= 950 } @SubscribeEvent def onLivingSetAttackTarget(e: LivingSetAttackTargetEvent) { if (!e.entity.worldObj.isRemote && e.target.isInstanceOf[EntityPlayer]) { val player: EntityPlayer = e.target.asInstanceOf[EntityPlayer] if (playersToCheck.contains(player.getCommandSenderName)) { e.entityLiving.setRevengeTarget(null) if (e.entityLiving.isInstanceOf[EntityLiving]) { e.entityLiving.asInstanceOf[EntityLiving].setAttackTarget(null) if (e.entityLiving.isInstanceOf[EntityCreature]) { e.entityLiving.asInstanceOf[EntityCreature].setTarget(null) } } } } } }
  2. Hello, I was wondering if anyone here has a tutorial relevant to 1.5 for implementing a liquid with forge. However I have already looked at many sources of mods and got most of it working however it crashes when entering a tank I tried setting the rendering icon however I have no Idea how to do that if someone could help that would be wonderful.
  3. Hello, I looked into the code of buildcraft and they set a rendering icon however the way they do it gives me some errors in eclipse could someone show me how to do this?
  4. Hello, Recently I have been working on implementing a custom liquid into my mod. However I've had many issues that have been fixed since but the most recent is that my liquid crashes when entering a buildcraft tank. The liquid renders find on the ground and in pipes however when it enters a tank the game instantly crashes. I get the following error in the console. http://paste.minecraftforge.net/view/08938f3b My ModLiquids class is as follows. http://paste.minecraftforge.net/view/6cc5fcf8 My Flowing liquid class is as follows. http://paste.minecraftforge.net/view/2a675653 My Still liquid class is as follows. http://paste.minecraftforge.net/view/0c9e659e Hopefully someone can help me fix this up so I can get working on tileentities and such.
  5. Hello, over the course of the past few days I have been trying to get a custom liquid implemented into my mod however no matter which of the many ways I've found I always end up with generally the same error. Here are my relevant classes and the error that appears in the console (If you need the crash report just post a reply and I'll grab it as soon as I can.). The Error in the Console is http://paste.minecraftforge.net/view/f5124d8f My class to initialize blocks http://paste.minecraftforge.net/view/0af8708a My Flowing Liquid class http://paste.minecraftforge.net/view/17649b29 My Still Liquid class http://paste.minecraftforge.net/view/e1aba073 Thanks in advance!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.