Started adding the dart blower. Added poison item.
This commit is contained in:
parent
ca5b7b4fe8
commit
ac6be03582
17 changed files with 155 additions and 3 deletions
|
@ -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());
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -34,4 +34,7 @@ public class Items
|
|||
public static Optional<? extends Item> shroomPowder = Optional.absent();
|
||||
public static Optional<? extends Item> miscItems = Optional.absent();
|
||||
public static Optional<? extends Item> mudball = Optional.absent();
|
||||
public static Optional<? extends Item> poison = Optional.absent();
|
||||
public static Optional<? extends Item> dartBlower = Optional.absent();
|
||||
public static Optional<? extends Item> dart = Optional.absent();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
20
src/minecraft/biomesoplenty/items/ItemDart.java
Normal file
20
src/minecraft/biomesoplenty/items/ItemDart.java
Normal file
|
@ -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");
|
||||
}
|
||||
}
|
40
src/minecraft/biomesoplenty/items/ItemDartBlower.java
Normal file
40
src/minecraft/biomesoplenty/items/ItemDartBlower.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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());
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
|
|
BIN
src/minecraft/mods/BiomesOPlenty/textures/items/dart.png
Normal file
BIN
src/minecraft/mods/BiomesOPlenty/textures/items/dart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 296 B |
BIN
src/minecraft/mods/BiomesOPlenty/textures/items/dartblower.png
Normal file
BIN
src/minecraft/mods/BiomesOPlenty/textures/items/dartblower.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 328 B |
BIN
src/minecraft/mods/BiomesOPlenty/textures/items/poison.png
Normal file
BIN
src/minecraft/mods/BiomesOPlenty/textures/items/poison.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 345 B |
Loading…
Reference in a new issue