diff --git a/src/minecraft/biomesoplenty/ClientProxy.java b/src/minecraft/biomesoplenty/ClientProxy.java index 6d6f2f585..5b923f719 100644 --- a/src/minecraft/biomesoplenty/ClientProxy.java +++ b/src/minecraft/biomesoplenty/ClientProxy.java @@ -9,6 +9,7 @@ import net.minecraftforge.client.MinecraftForgeClient; import biomesoplenty.api.Items; import biomesoplenty.blocks.renderers.FoliageRenderer; import biomesoplenty.blocks.renderers.PlantsRenderer; +import biomesoplenty.items.projectiles.EntityDart; import biomesoplenty.items.projectiles.EntityMudball; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -25,6 +26,7 @@ public class ClientProxy extends CommonProxy { MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST2_PNG); RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(Items.mudball.get(), 0)); + RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, new RenderSnowball(Items.dart.get(), 0)); RenderingRegistry.registerBlockHandler(new FoliageRenderer()); RenderingRegistry.registerBlockHandler(new PlantsRenderer()); diff --git a/src/minecraft/biomesoplenty/api/Entities.java b/src/minecraft/biomesoplenty/api/Entities.java index 3417d72ed..db8056df3 100644 --- a/src/minecraft/biomesoplenty/api/Entities.java +++ b/src/minecraft/biomesoplenty/api/Entities.java @@ -3,6 +3,7 @@ package biomesoplenty.api; public class Entities { public static Class Mudball = getClass("biomesoplenty.items.projectiles.EntityMudball"); + public static Class Dart = getClass("biomesoplenty.items.projectiles.EntityDart"); public static Class JungleSpider = getClass("biomesoplenty.mobs.EntityJungleSpider"); public static Class Rosester = getClass("biomesoplenty.mobs.EntityRosester"); diff --git a/src/minecraft/biomesoplenty/api/Items.java b/src/minecraft/biomesoplenty/api/Items.java index 07529dab4..4ef616fe6 100644 --- a/src/minecraft/biomesoplenty/api/Items.java +++ b/src/minecraft/biomesoplenty/api/Items.java @@ -34,4 +34,7 @@ public class Items public static Optional shroomPowder = Optional.absent(); public static Optional miscItems = Optional.absent(); public static Optional mudball = Optional.absent(); + public static Optional poison = Optional.absent(); + public static Optional dartBlower = Optional.absent(); + public static Optional dart = Optional.absent(); } diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index 5a6094ee9..cc9febf70 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -184,6 +184,8 @@ public class BOPConfiguration { public static int miscItemsID; public static int mudballID; + public static int dartBlowerID; + public static int dartID; public static int swordMudID; public static int shovelMudID; @@ -647,6 +649,8 @@ public class BOPConfiguration { miscItemsID = config.getItem("Misc Items ID", 21010).getInt(); mudballID = config.getItem("Mud Ball ID", 21011).getInt(); + dartBlowerID = config.getItem("Dart Blower ID", 21012).getInt(); + dartID = config.getItem("Dart ID", 21013).getInt(); bopDiscID = config.getItem("Traversia Music Disc ID", 21019, null).getInt(); bopDiscMudID = config.getItem("Muddy Music Disc ID", 21020, null).getInt(); diff --git a/src/minecraft/biomesoplenty/configuration/BOPCrafting.java b/src/minecraft/biomesoplenty/configuration/BOPCrafting.java index c7c60b4e3..c0b1b584b 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPCrafting.java +++ b/src/minecraft/biomesoplenty/configuration/BOPCrafting.java @@ -146,6 +146,9 @@ public class BOPCrafting GameRegistry.addRecipe(new ItemStack(Items.ancientStaff.get(), 1, 3), new Object[] {" N ", "IDI", "ISI", 'I', Item.ingotIron, 'S', Block.whiteStone, 'D', Item.diamond, 'N', Item.netherStar}); GameRegistry.addRecipe(new ItemStack(Items.enderporter.get(), 1, 0), new Object[] {"IOI", "OAO", "IOI", 'I', Item.eyeOfEnder, 'O', Block.obsidian, 'A', new ItemStack(Blocks.amethystOre.get(), 1, 1)}); GameRegistry.addRecipe(new ItemStack(Items.bopDiscMud.get(), 1), new Object[] {" M ", "MDM", " M ", 'M', Items.mudball.get(), 'D', Items.bopDisc.get()}); + + //Dart Blower + GameRegistry.addRecipe(new ItemStack(Items.dartBlower.get(), 1), new Object[] {"R R", "R R", "R R", Character.valueOf('R'), new ItemStack(Blocks.plants.get(), 1, 8)}); GameRegistry.addRecipe(new ItemStack(Blocks.planks.get(), 1, 10), new Object[] {"##", "##", '#', Blocks.bamboo.get()}); @@ -154,6 +157,7 @@ public class BOPCrafting //Plants GameRegistry.addShapelessRecipe(new ItemStack(Items.shroomPowder.get(), 2), new Object[] {new ItemStack(Blocks.flowers.get(),1,10)}); + GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 2, 3), new Object[] {new ItemStack(Blocks.foliage.get(),1,6)}); } private static void addSmeltingRecipes() diff --git a/src/minecraft/biomesoplenty/configuration/BOPEntities.java b/src/minecraft/biomesoplenty/configuration/BOPEntities.java index edaa68888..eec2cb6aa 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPEntities.java +++ b/src/minecraft/biomesoplenty/configuration/BOPEntities.java @@ -5,6 +5,7 @@ import com.google.common.base.Optional; import biomesoplenty.BiomesOPlenty; import biomesoplenty.api.Biomes; import biomesoplenty.api.Entities; +import biomesoplenty.items.projectiles.EntityDart; import biomesoplenty.items.projectiles.EntityMudball; import biomesoplenty.mobs.EntityJungleSpider; import biomesoplenty.mobs.EntityRosester; @@ -39,6 +40,7 @@ public class BOPEntities { public static void init() { EntityRegistry.registerModEntity(EntityMudball.class, "MudBall", EntityRegistry.findGlobalUniqueEntityId(), BiomesOPlenty.instance, 80, 3, true); + EntityRegistry.registerModEntity(EntityDart.class, "Dart", EntityRegistry.findGlobalUniqueEntityId(), BiomesOPlenty.instance, 80, 3, true); EntityRegistry.registerModEntity(EntityJungleSpider.class, "JungleSpider", BOPConfiguration.jungleSpiderID, BiomesOPlenty.instance, 80, 3, true); EntityRegistry.registerModEntity(EntityRosester.class, "Rosester", BOPConfiguration.rosesterID, BiomesOPlenty.instance, 80, 3, true); diff --git a/src/minecraft/biomesoplenty/configuration/BOPItems.java b/src/minecraft/biomesoplenty/configuration/BOPItems.java index 7cab2653e..1799f9c3c 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPItems.java +++ b/src/minecraft/biomesoplenty/configuration/BOPItems.java @@ -24,6 +24,8 @@ import biomesoplenty.items.ItemBOPRecord; import biomesoplenty.items.ItemBOPRecordMud; import biomesoplenty.items.ItemBOPSpade; import biomesoplenty.items.ItemBOPSword; +import biomesoplenty.items.ItemDart; +import biomesoplenty.items.ItemDartBlower; import biomesoplenty.items.ItemEnderporter; import biomesoplenty.items.ItemShroomPowder; import biomesoplenty.items.overrides.ItemShears; @@ -103,6 +105,8 @@ public class BOPItems { Items.shroomPowder = Optional.of(new ItemShroomPowder(BOPConfiguration.shroomPowderID, 1, 0.5F, false)); Items.miscItems = Optional.of(new ItemBOP(BOPConfiguration.miscItemsID)); Items.mudball = Optional.of(new ItemBOPMudball(BOPConfiguration.mudballID)); + Items.dartBlower = Optional.of(new ItemDartBlower(BOPConfiguration.dartBlowerID)); + Items.dart = Optional.of(new ItemDart(BOPConfiguration.dartID)); Items.ancientStaff = Optional.of(new ItemBOPAncientStaff(BOPConfiguration.ancientStaffID)); @@ -136,9 +140,12 @@ public class BOPItems { { LanguageRegistry.addName(Items.shroomPowder.get(), "Shroom Powder"); LanguageRegistry.addName(Items.mudball.get(), "Mud Ball"); + LanguageRegistry.addName(Items.dartBlower.get(), "Dart Blower"); + LanguageRegistry.addName(Items.dart.get(), "Dart"); LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 0), "Mud Brick"); LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 2), "Amethyst"); LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 1), "Pile of Ashes"); + LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 3), "Poison"); LanguageRegistry.addName(Items.pickaxeMud.get(), "Muddy Pickaxe"); LanguageRegistry.addName(Items.axeMud.get(), "Muddy Axe"); diff --git a/src/minecraft/biomesoplenty/configuration/BOPVanillaCompat.java b/src/minecraft/biomesoplenty/configuration/BOPVanillaCompat.java index 0667887c9..1df13b327 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPVanillaCompat.java +++ b/src/minecraft/biomesoplenty/configuration/BOPVanillaCompat.java @@ -2,6 +2,7 @@ package biomesoplenty.configuration; import biomesoplenty.api.Blocks; import biomesoplenty.api.Items; +import biomesoplenty.items.projectiles.DispenserBehaviorDart; import biomesoplenty.items.projectiles.DispenserBehaviorMudball; import net.minecraft.block.BlockDispenser; import net.minecraft.item.Item; @@ -15,6 +16,7 @@ public class BOPVanillaCompat { { // Dispenser behavior for mud balls BlockDispenser.dispenseBehaviorRegistry.putObject(Items.mudball.get(), new DispenserBehaviorMudball()); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.dart.get(), new DispenserBehaviorDart()); ChestGenHooks dungeon; ChestGenHooks mineshaft; diff --git a/src/minecraft/biomesoplenty/items/ItemBOP.java b/src/minecraft/biomesoplenty/items/ItemBOP.java index 85bd8192b..bec04d202 100644 --- a/src/minecraft/biomesoplenty/items/ItemBOP.java +++ b/src/minecraft/biomesoplenty/items/ItemBOP.java @@ -13,7 +13,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class ItemBOP extends Item { - private static String[] items = {"mudbrick", "ash", "amethyst"}; + private static String[] items = {"mudbrick", "ash", "amethyst", "poison"}; @SideOnly(Side.CLIENT) private Icon[] textures; diff --git a/src/minecraft/biomesoplenty/items/ItemDart.java b/src/minecraft/biomesoplenty/items/ItemDart.java new file mode 100644 index 000000000..2248b5165 --- /dev/null +++ b/src/minecraft/biomesoplenty/items/ItemDart.java @@ -0,0 +1,20 @@ +package biomesoplenty.items; + +import biomesoplenty.BiomesOPlenty; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.item.Item; + +public class ItemDart extends Item +{ + public ItemDart(int par1) + { + super(par1); + setUnlocalizedName("shroomPowder"); + setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); + } + + public void registerIcons(IconRegister iconRegister) + { + itemIcon = iconRegister.registerIcon("BiomesOPlenty:dart"); + } +} diff --git a/src/minecraft/biomesoplenty/items/ItemDartBlower.java b/src/minecraft/biomesoplenty/items/ItemDartBlower.java new file mode 100644 index 000000000..1233da186 --- /dev/null +++ b/src/minecraft/biomesoplenty/items/ItemDartBlower.java @@ -0,0 +1,40 @@ +package biomesoplenty.items; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import biomesoplenty.BiomesOPlenty; +import biomesoplenty.items.projectiles.EntityDart; + +public class ItemDartBlower extends Item +{ + public ItemDartBlower(int par1) + { + super(par1); + this.maxStackSize = 1; + this.setMaxDamage(192); + setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); + setUnlocalizedName("dartblower"); + } + + public void registerIcons(IconRegister iconRegister) + { + itemIcon = iconRegister.registerIcon("BiomesOPlenty:dartblower"); + } + + public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + --itemStack.stackSize; + + + par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 2.0F / (1.0F * 0.4F + 1.2F) + 1.0F * 0.5F); + + if (!par2World.isRemote) + par2World.spawnEntityInWorld(new EntityDart(par2World, par3EntityPlayer)); + + return itemStack; + } +} diff --git a/src/minecraft/biomesoplenty/items/projectiles/DispenserBehaviorDart.java b/src/minecraft/biomesoplenty/items/projectiles/DispenserBehaviorDart.java new file mode 100644 index 000000000..8cca6cefa --- /dev/null +++ b/src/minecraft/biomesoplenty/items/projectiles/DispenserBehaviorDart.java @@ -0,0 +1,14 @@ +package biomesoplenty.items.projectiles; + +import net.minecraft.dispenser.BehaviorProjectileDispense; +import net.minecraft.dispenser.IPosition; +import net.minecraft.entity.IProjectile; +import net.minecraft.world.World; + +public class DispenserBehaviorDart extends BehaviorProjectileDispense +{ + protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) + { + return new EntityDart(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); + } +} diff --git a/src/minecraft/biomesoplenty/items/projectiles/EntityDart.java b/src/minecraft/biomesoplenty/items/projectiles/EntityDart.java new file mode 100644 index 000000000..bafcad418 --- /dev/null +++ b/src/minecraft/biomesoplenty/items/projectiles/EntityDart.java @@ -0,0 +1,53 @@ +package biomesoplenty.items.projectiles; + +import biomesoplenty.ClientProxy; +import biomesoplenty.BiomesOPlenty; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityDart extends EntityThrowable +{ + boolean isClient = BiomesOPlenty.proxy instanceof ClientProxy; + + public EntityDart(World par1World) + { + super(par1World); + } + + public EntityDart(World par1World, EntityLiving par2EntityLiving) + { + super(par1World, par2EntityLiving); + } + + public EntityDart(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + @Override + protected void onImpact(MovingObjectPosition par1MovingObjectPosition) + { + + if (par1MovingObjectPosition.entityHit != null) + { + par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 2); + //((EntityLiving)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 300)); + } + + for (int i = 0; i < 16; ++i) + { + //BiomesOPlenty.proxy.spawnMud(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + + if (!this.worldObj.isRemote) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/src/minecraft/biomesoplenty/items/projectiles/EntityMudball.java b/src/minecraft/biomesoplenty/items/projectiles/EntityMudball.java index ae40c093d..be2ec4aca 100644 --- a/src/minecraft/biomesoplenty/items/projectiles/EntityMudball.java +++ b/src/minecraft/biomesoplenty/items/projectiles/EntityMudball.java @@ -36,8 +36,8 @@ public class EntityMudball extends EntityThrowable if (par1MovingObjectPosition.entityHit != null) { - par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 1); - ((EntityLiving)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 300)); + par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0); + ((EntityLiving)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 4)); } for (int i = 0; i < 16; ++i) diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/dart.png b/src/minecraft/mods/BiomesOPlenty/textures/items/dart.png new file mode 100644 index 000000000..d4b06dbbe Binary files /dev/null and b/src/minecraft/mods/BiomesOPlenty/textures/items/dart.png differ diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/dartblower.png b/src/minecraft/mods/BiomesOPlenty/textures/items/dartblower.png new file mode 100644 index 000000000..d286f182e Binary files /dev/null and b/src/minecraft/mods/BiomesOPlenty/textures/items/dartblower.png differ diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/poison.png b/src/minecraft/mods/BiomesOPlenty/textures/items/poison.png new file mode 100644 index 000000000..14a9be6aa Binary files /dev/null and b/src/minecraft/mods/BiomesOPlenty/textures/items/poison.png differ