diff --git a/src/main/java/iDiamondhunter/morebows/MoreBows.java b/src/main/java/iDiamondhunter/morebows/MoreBows.java index 6d9983b..7a4f20b 100644 --- a/src/main/java/iDiamondhunter/morebows/MoreBows.java +++ b/src/main/java/iDiamondhunter/morebows/MoreBows.java @@ -54,8 +54,8 @@ public class MoreBows { /* This is super janky. */ private final static String modSeperator = "morebows:"; - public final static Item DiamondBow = new CustomBow(1016, (byte) 0, new byte[] {8, 4}, 2.2F, 6F, 140, 2.25, 36000).setUnlocalizedName(DiamondBowName).setTextureName(modSeperator + DiamondBowName); - public final static Item GoldBow = new CustomBow(550, (byte) 0, new byte[] {8, 4}, 2.4F, 5F, 100, 1.5D).setUnlocalizedName(GoldBowName).setTextureName(modSeperator + GoldBowName); + public final static Item DiamondBow = new CustomBow(1016, (byte) 2, new byte[] {8, 4}, 2.2F, 6F, 140, 2.25, 36000).setUnlocalizedName(DiamondBowName).setTextureName(modSeperator + DiamondBowName); + public final static Item GoldBow = new CustomBow(550, (byte) 1, new byte[] {8, 4}, 2.4F, 5F, 100, 1.5D).setUnlocalizedName(GoldBowName).setTextureName(modSeperator + GoldBowName); public final static Item EnderBow = new EnderBow().setUnlocalizedName(EnderBowName).setTextureName(modSeperator + EnderBowName); public final static Item StoneBow = new CustomBow(484, (byte) 0, null, 17F, 1.15D, true).setUnlocalizedName(StoneBowName).setTextureName(modSeperator + StoneBowName); public final static Item IronBow = new CustomBow(550, (byte) 0, new byte[] {16, 11}, 2.1F, 17F, 105, 1.5D).setUnlocalizedName(IronBowName).setTextureName(modSeperator + IronBowName); @@ -68,7 +68,7 @@ public void init(FMLInitializationEvent event) { registerItems(); registerEntities(); proxy.register(); - MinecraftForge.EVENT_BUS.register(new Util()); + MinecraftForge.EVENT_BUS.register(proxy); } /** TODO Remove before release? */ @@ -120,34 +120,26 @@ private void registerItems() { GameRegistry.registerItem(FlameBow, FlameBowName); GameRegistry.registerItem(FrostBow, FrostBowName); /** Recipes */ - GameRegistry.addRecipe(new ItemStack(StoneBow, 1), " Ss", "TBs", " Ss", 'T', Items.stick, 's', Items.string, 'S', - Blocks.stone, 'B', Items.bow); - GameRegistry.addRecipe(new ItemStack(StoneBow, 1), "sS ", "sBT", "sS ", 'T', Items.stick, 's', Items.string, 'S', - Blocks.stone, 'B', Items.bow); - GameRegistry.addRecipe(new ItemStack(IronBow, 1), " Is", "IBs", " Is", 's', Items.string, 'I', Items.iron_ingot, 'B', - Items.bow); - GameRegistry.addRecipe(new ItemStack(IronBow, 1), "sI ", "sBI", "sI ", 's', Items.string, 'I', Items.iron_ingot, 'B', - Items.bow); - GameRegistry.addRecipe(new ItemStack(GoldBow, 1), " Gs", "GBs", " Gs", 's', Items.string, 'G', Items.gold_ingot, 'B', - Items.bow); - GameRegistry.addRecipe(new ItemStack(GoldBow, 1), "sG ", "sBG", "sG ", 's', Items.string, 'G', Items.gold_ingot, 'B', - Items.bow); - GameRegistry.addRecipe(new ItemStack(DiamondBow, 1), " Ds", "IBs", " Ds", 's', Items.string, 'D', Items.diamond, 'I', - Items.iron_ingot, 'B', Items.bow); - GameRegistry.addRecipe(new ItemStack(DiamondBow, 1), "sD ", "sBI", "sD ", 's', Items.string, 'D', Items.diamond, 'I', - Items.iron_ingot, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(StoneBow, 1), " Ss", "TBs", " Ss", 'T', Items.stick, 's', Items.string, 'S', Blocks.stone, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(StoneBow, 1), "sS ", "sBT", "sS ", 'T', Items.stick, 's', Items.string, 'S', Blocks.stone, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(IronBow, 1), " Is", "IBs", " Is", 's', Items.string, 'I', Items.iron_ingot, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(IronBow, 1), "sI ", "sBI", "sI ", 's', Items.string, 'I', Items.iron_ingot, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(GoldBow, 1), " Gs", "GBs", " Gs", 's', Items.string, 'G', Items.gold_ingot, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(GoldBow, 1), "sG ", "sBG", "sG ", 's', Items.string, 'G', Items.gold_ingot, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(DiamondBow, 1), " Ds", "IBs", " Ds", 's', Items.string, 'D', Items.diamond, 'I', Items.iron_ingot, 'B', Items.bow); + GameRegistry.addRecipe(new ItemStack(DiamondBow, 1), "sD ", "sBI", "sD ", 's', Items.string, 'D', Items.diamond, 'I', Items.iron_ingot, 'B', Items.bow); GameRegistry.addRecipe(new ItemStack(MultiBow, 1), " Bs", "I s", " Bs", 's', Items.string, 'I', Items.iron_ingot, 'B', IronBow); GameRegistry.addRecipe(new ItemStack(MultiBow, 1), "sB ", "s I", "sB ", 's', Items.string, 'I', Items.iron_ingot, 'B', IronBow); - GameRegistry.addRecipe(new ItemStack(FlameBow, 1), "NB ", "GI ", "NB ", 'G', Items.gold_ingot, 'B', Items.blaze_rod, 'I', IronBow, 'N', - Blocks.netherrack); - GameRegistry.addRecipe(new ItemStack(FlameBow, 1), " NB", " GI", " NB", 'G', Items.gold_ingot, 'B', Items.blaze_rod, 'I', IronBow, 'N', - Blocks.netherrack); - GameRegistry.addRecipe(new ItemStack(EnderBow, 1), "GP ", "EI ", "GP ", 'G', Items.gold_ingot, 'P', Items.ender_pearl, 'I', IronBow, 'E', - Items.ender_eye); - GameRegistry.addRecipe(new ItemStack(EnderBow, 1), " GP", " EI", " GP", 'G', Items.gold_ingot, 'P', Items.ender_pearl, 'I', IronBow, 'E', - Items.ender_eye); - GameRegistry.addRecipe(new ItemStack(FrostBow, 1), " IR", "SER", " IR", 'R', Items.string, 'I', Blocks.ice, 'S', - Items.snowball, 'E', IronBow); + GameRegistry.addRecipe(new ItemStack(FlameBow, 1), "NB ", "GI ", "NB ", 'G', Items.gold_ingot, 'B', Items.blaze_rod, 'I', IronBow, 'N', Blocks.netherrack); + GameRegistry.addRecipe(new ItemStack(FlameBow, 1), " NB", " GI", " NB", 'G', Items.gold_ingot, 'B', Items.blaze_rod, 'I', IronBow, 'N', Blocks.netherrack); + GameRegistry.addRecipe(new ItemStack(FlameBow, 1), "BN ", "IG ", "BN ", 'G', Items.gold_ingot, 'B', Items.blaze_rod, 'I', IronBow, 'N', Blocks.netherrack); + GameRegistry.addRecipe(new ItemStack(FlameBow, 1), " BN", " IG", " BN", 'G', Items.gold_ingot, 'B', Items.blaze_rod, 'I', IronBow, 'N', Blocks.netherrack); + GameRegistry.addRecipe(new ItemStack(EnderBow, 1), "GP ", "EI ", "GP ", 'G', Items.gold_ingot, 'P', Items.ender_pearl, 'I', IronBow, 'E', Items.ender_eye); + GameRegistry.addRecipe(new ItemStack(EnderBow, 1), " GP", " EI", " GP", 'G', Items.gold_ingot, 'P', Items.ender_pearl, 'I', IronBow, 'E', Items.ender_eye); + GameRegistry.addRecipe(new ItemStack(EnderBow, 1), "PG ", "IE ", "PG ", 'G', Items.gold_ingot, 'P', Items.ender_pearl, 'I', IronBow, 'E', Items.ender_eye); + GameRegistry.addRecipe(new ItemStack(EnderBow, 1), " PG", " IE", " PG", 'G', Items.gold_ingot, 'P', Items.ender_pearl, 'I', IronBow, 'E', Items.ender_eye); + GameRegistry.addRecipe(new ItemStack(FrostBow, 1), " IR", "SER", " IR", 'R', Items.string, 'I', Blocks.ice, 'S', Items.snowball, 'E', IronBow); + GameRegistry.addRecipe(new ItemStack(FrostBow, 1), "RI ", "RES", "RI ", 'R', Items.string, 'I', Blocks.ice, 'S', Items.snowball, 'E', IronBow); } } diff --git a/src/main/java/iDiamondhunter/morebows/Util.java b/src/main/java/iDiamondhunter/morebows/Util.java deleted file mode 100644 index 5bde7ca..0000000 --- a/src/main/java/iDiamondhunter/morebows/Util.java +++ /dev/null @@ -1,84 +0,0 @@ -package iDiamondhunter.morebows; - -import java.util.Random; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import iDiamondhunter.morebows.bows.CustomBow; -import iDiamondhunter.morebows.entities.CustomArrow; -import net.minecraft.entity.Entity; -import net.minecraft.world.WorldServer; -import net.minecraftforge.client.event.FOVUpdateEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; - -/* TODO See if these can be merged into another class */ -public class Util { - - static Random rand = new Random(); - - public static void spawnParticle(WorldServer server, Entity entity, String particle) { - final int numPart = 1; - final double vel = 1; - // Create particle - // onLivingHurtEvent is only ever the server world - // func_147487_a seems to be a helper method to send a packet to all clients, which then spawns a particle. - // someone on the forums defined it as WorldServer#func_147487_a(String particleName, double x, double y, double z, int numParticles, double displacementX, double displacementY, double displacementZ, double velocity) - // https://forums.minecraftforge.net/topic/36526-1710-spawning-particles-the-world/ - // http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-modding-tips.html - // https://forums.minecraftforge.net/topic/21292-1710-spawn-particles/ - // https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/2729635-particles-not-spawning?page=2 - // (String particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed) - // original event.entity.worldObj.spawnParticle(particle, (event.entity.posX + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, event.entity.posY + 0.5D + (rand.nextFloat() * event.entity.height), (event.entity.posZ + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D); - //server.func_147487_a(particle, (event.entity.posX + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, event.entity.posY + 0.5D + (rand.nextFloat() * event.entity.height), (event.entity.posZ + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, numPart /* Number of particles? */, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D, vel /* Velocity? Not sure... */); - server.func_147487_a(particle, (entity.posX + (rand.nextFloat() * entity.width * 2.0F)) - entity.width, entity.posY + 0.5D + (rand.nextFloat() * entity.height), (entity.posZ + (rand.nextFloat() * entity.width * 2.0F)) - entity.width, numPart /* Number of particles? */, 0, 0, 0, vel /* Velocity? Not sure... */); - //iDiamondhunter.morebows.MoreBows.modLog.error("Particle spawned! entity " + entity.getClass().getName() + " particle " + particle); //debug - } - - @SubscribeEvent - public void arrHit(LivingAttackEvent event) { - //iDiamondhunter.morebows.MoreBows.modLog.error("Test ParticleArrow " + event.entity.worldObj.isRemote + " test " + this.getClass().getName() + " " + this.toString()); //debug - //iDiamondhunter.morebows.MoreBows.modLog.error("An attack was detected."); //debug - - /*if (event.source.getSourceOfDamage() instanceof CustomArrow) { - iDiamondhunter.morebows.MoreBows.modLog.error("Event was a custom arrow: " + event.source.getSourceOfDamage().getClass().getName()); //debug - - if (!event.entity.worldObj.isRemote) { - iDiamondhunter.morebows.MoreBows.modLog.error("World was server."); //debug - } else { - iDiamondhunter.morebows.MoreBows.modLog.error("World was client."); //debug - } - } else { - iDiamondhunter.morebows.MoreBows.modLog.error("Event was not custom arrow"); //debug - }*/ - if (!event.entity.worldObj.isRemote && (event.source.getSourceOfDamage() instanceof CustomArrow)) { - //iDiamondhunter.morebows.MoreBows.modLog.error("Test arr " + event.entity.worldObj.isRemote); //debug - // TODO Document - //event.entity.worldObj.spawn - final CustomArrow arr = (CustomArrow) event.source.getSourceOfDamage(); - final WorldServer server = (WorldServer) event.entity.worldObj; - spawnParticle(server, event.entity, "portal"); - - // TODO Figure out that weird code from the fire arrow. - if (arr.fire) { - event.entity.setFire(15); - } //else if (arr.type == 2) {} - } - } - - @SubscribeEvent - public void FOVUpdate(FOVUpdateEvent event) { - if ((event.entity.getItemInUse() != null) && (event.entity.getItemInUse().getItem() instanceof CustomBow)) { - // See net.minecraft.client.entity.EntityPlayerSP.getFOVMultiplier() - final CustomBow bow = (CustomBow) event.entity.getItemInUse().getItem(); - float f1 = (float) event.entity.getItemInUseDuration() / (float) (bow.iconTimes[0] * (10 / 9)); - - if (f1 > 1.0F) { - f1 = 1.0F; - } else { - f1 *= f1; - } - - event.newfov *= 1.0F - (f1 * 0.15F); - } - } - -} diff --git a/src/main/java/iDiamondhunter/morebows/bows/CustomBow.java b/src/main/java/iDiamondhunter/morebows/bows/CustomBow.java index f5d2fa1..f8fef8e 100644 --- a/src/main/java/iDiamondhunter/morebows/bows/CustomBow.java +++ b/src/main/java/iDiamondhunter/morebows/bows/CustomBow.java @@ -54,17 +54,21 @@ public CustomBow(int maxDamage, byte rarity, byte[] iconTimes) { EnumRarity detRare; switch (rarity) { - case 0: + case (byte) 1: detRare = EnumRarity.uncommon; + break; - case 1: + case (byte) 2: detRare = EnumRarity.rare; + break; - case 2: + case (byte) 3: detRare = EnumRarity.epic; + break; default: detRare = EnumRarity.common; + break; } this.rarity = detRare; diff --git a/src/main/java/iDiamondhunter/morebows/bows/EnderBow.java b/src/main/java/iDiamondhunter/morebows/bows/EnderBow.java index 5fd5c7e..d72f667 100644 --- a/src/main/java/iDiamondhunter/morebows/bows/EnderBow.java +++ b/src/main/java/iDiamondhunter/morebows/bows/EnderBow.java @@ -1,8 +1,8 @@ package iDiamondhunter.morebows.bows; -import iDiamondhunter.morebows.Util; import iDiamondhunter.morebows.entities.ArrowSpawner; import iDiamondhunter.morebows.entities.CustomArrow; +import iDiamondhunter.morebows.proxy.Common; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; @@ -14,7 +14,7 @@ public class EnderBow extends CustomBow { public EnderBow() { - super(384, (byte) 0, null, 22F); + super(384, (byte) 3, null, 22F); MinecraftForge.EVENT_BUS.register(this); } @@ -22,7 +22,7 @@ public EnderBow() { @Override public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) { if (!entityLiving.worldObj.isRemote) { - Util.spawnParticle((WorldServer) entityLiving.worldObj, entityLiving, "portal"); + Common.spawnParticle((WorldServer) entityLiving.worldObj, entityLiving, "portal"); } return false; diff --git a/src/main/java/iDiamondhunter/morebows/bows/FlameBow.java b/src/main/java/iDiamondhunter/morebows/bows/FlameBow.java index 8c7869f..31c230a 100644 --- a/src/main/java/iDiamondhunter/morebows/bows/FlameBow.java +++ b/src/main/java/iDiamondhunter/morebows/bows/FlameBow.java @@ -10,7 +10,7 @@ public class FlameBow extends CustomBow { public FlameBow() { - super(576, (byte) 0, new byte[] {14, 9}, 15F, 2.0D); + super(576, (byte) 1, new byte[] {14, 9}, 15F, 2.0D); } @Override diff --git a/src/main/java/iDiamondhunter/morebows/bows/MultiBow.java b/src/main/java/iDiamondhunter/morebows/bows/MultiBow.java index e091189..8a49e04 100644 --- a/src/main/java/iDiamondhunter/morebows/bows/MultiBow.java +++ b/src/main/java/iDiamondhunter/morebows/bows/MultiBow.java @@ -11,7 +11,7 @@ public class MultiBow extends CustomBow { protected boolean thirdArrow = false; public MultiBow() { - super(550, (byte) 0, new byte[] {12, 7}, 13F); + super(550, (byte) 2, new byte[] {12, 7}, 13F); } @Override diff --git a/src/main/java/iDiamondhunter/morebows/proxy/Client.java b/src/main/java/iDiamondhunter/morebows/proxy/Client.java index b49326d..006cf04 100644 --- a/src/main/java/iDiamondhunter/morebows/proxy/Client.java +++ b/src/main/java/iDiamondhunter/morebows/proxy/Client.java @@ -1,15 +1,35 @@ package iDiamondhunter.morebows.proxy; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import iDiamondhunter.morebows.bows.CustomBow; import iDiamondhunter.morebows.client.NoRender; import iDiamondhunter.morebows.entities.ArrowSpawner; import iDiamondhunter.morebows.entities.FrostArrow; import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.init.Items; +import net.minecraftforge.client.event.FOVUpdateEvent; /** TODO Remove if not needed */ public class Client extends Common { + @SubscribeEvent + public void FOVUpdate(FOVUpdateEvent event) { + if ((event.entity.getItemInUse() != null) && (event.entity.getItemInUse().getItem() instanceof CustomBow)) { + // See net.minecraft.client.entity.EntityPlayerSP.getFOVMultiplier() + final CustomBow bow = (CustomBow) event.entity.getItemInUse().getItem(); + float f1 = (float) event.entity.getItemInUseDuration() / (float) (bow.iconTimes[0] * (10 / 9)); + + if (f1 > 1.0F) { + f1 = 1.0F; + } else { + f1 *= f1; + } + + event.newfov *= 1.0F - (f1 * 0.15F); + } + } + @Override public void register() { RenderingRegistry.registerEntityRenderingHandler(ArrowSpawner.class, new NoRender()); diff --git a/src/main/java/iDiamondhunter/morebows/proxy/Common.java b/src/main/java/iDiamondhunter/morebows/proxy/Common.java index ac46f1a..bf7a7cd 100644 --- a/src/main/java/iDiamondhunter/morebows/proxy/Common.java +++ b/src/main/java/iDiamondhunter/morebows/proxy/Common.java @@ -1,8 +1,67 @@ package iDiamondhunter.morebows.proxy; +import java.util.Random; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import iDiamondhunter.morebows.entities.CustomArrow; +import net.minecraft.entity.Entity; +import net.minecraft.world.WorldServer; +import net.minecraftforge.event.entity.living.LivingAttackEvent; + /** TODO Remove if not needed */ public class Common { + static Random rand = new Random(); + + public static void spawnParticle(WorldServer server, Entity entity, String particle) { + final int numPart = 1; + final double vel = 1; + // Create particle + // onLivingHurtEvent is only ever the server world + // func_147487_a seems to be a helper method to send a packet to all clients, which then spawns a particle. + // someone on the forums defined it as WorldServer#func_147487_a(String particleName, double x, double y, double z, int numParticles, double displacementX, double displacementY, double displacementZ, double velocity) + // https://forums.minecraftforge.net/topic/36526-1710-spawning-particles-the-world/ + // http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-modding-tips.html + // https://forums.minecraftforge.net/topic/21292-1710-spawn-particles/ + // https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/2729635-particles-not-spawning?page=2 + // (String particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed) + // original event.entity.worldObj.spawnParticle(particle, (event.entity.posX + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, event.entity.posY + 0.5D + (rand.nextFloat() * event.entity.height), (event.entity.posZ + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D); + //server.func_147487_a(particle, (event.entity.posX + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, event.entity.posY + 0.5D + (rand.nextFloat() * event.entity.height), (event.entity.posZ + (rand.nextFloat() * event.entity.width * 2.0F)) - event.entity.width, numPart /* Number of particles? */, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D, rand.nextGaussian() * 0.02D, vel /* Velocity? Not sure... */); + server.func_147487_a(particle, (entity.posX + (rand.nextFloat() * entity.width * 2.0F)) - entity.width, entity.posY + 0.5D + (rand.nextFloat() * entity.height), (entity.posZ + (rand.nextFloat() * entity.width * 2.0F)) - entity.width, numPart /* Number of particles? */, 0, 0, 0, vel /* Velocity? Not sure... */); + //iDiamondhunter.morebows.MoreBows.modLog.error("Particle spawned! entity " + entity.getClass().getName() + " particle " + particle); //debug + } + + @SubscribeEvent + public void arrHit(LivingAttackEvent event) { + //iDiamondhunter.morebows.MoreBows.modLog.error("Test ParticleArrow " + event.entity.worldObj.isRemote + " test " + this.getClass().getName() + " " + this.toString()); //debug + //iDiamondhunter.morebows.MoreBows.modLog.error("An attack was detected."); //debug + + /*if (event.source.getSourceOfDamage() instanceof CustomArrow) { + iDiamondhunter.morebows.MoreBows.modLog.error("Event was a custom arrow: " + event.source.getSourceOfDamage().getClass().getName()); //debug + + if (!event.entity.worldObj.isRemote) { + iDiamondhunter.morebows.MoreBows.modLog.error("World was server."); //debug + } else { + iDiamondhunter.morebows.MoreBows.modLog.error("World was client."); //debug + } + } else { + iDiamondhunter.morebows.MoreBows.modLog.error("Event was not custom arrow"); //debug + }*/ + if (!event.entity.worldObj.isRemote && (event.source.getSourceOfDamage() instanceof CustomArrow)) { + //iDiamondhunter.morebows.MoreBows.modLog.error("Test arr " + event.entity.worldObj.isRemote); //debug + // TODO Document + //event.entity.worldObj.spawn + final CustomArrow arr = (CustomArrow) event.source.getSourceOfDamage(); + final WorldServer server = (WorldServer) event.entity.worldObj; + spawnParticle(server, event.entity, "portal"); + + // TODO Figure out that weird code from the fire arrow. + if (arr.fire) { + event.entity.setFire(15); + } //else if (arr.type == 2) {} + } + } + public void register() { // It's nothing! }