Removed dart blowers

This commit is contained in:
Forstride 2016-07-11 01:20:46 -04:00
parent 7060677e50
commit e4e429e547
24 changed files with 2 additions and 625 deletions

View file

@ -23,7 +23,6 @@ public class BOPAchievements
public static Achievement craft_muddy_pickaxe; public static Achievement craft_muddy_pickaxe;
public static Achievement craft_amethyst_sword; public static Achievement craft_amethyst_sword;
public static Achievement obtain_deathbloom; public static Achievement obtain_deathbloom;
public static Achievement craft_dart_blower;
public static Achievement obtain_turnip; public static Achievement obtain_turnip;
public static Achievement grow_sacred_oak; public static Achievement grow_sacred_oak;
public static Achievement obtain_honeycomb; public static Achievement obtain_honeycomb;

View file

@ -48,9 +48,6 @@ public class BOPItems
public static Item pinecone; public static Item pinecone;
public static Item other_slab; public static Item other_slab;
public static Item dart;
public static Item dart_blower;
public static Item sacred_oak_door; public static Item sacred_oak_door;
public static Item cherry_door; public static Item cherry_door;
public static Item umbran_door; public static Item umbran_door;

View file

@ -1,276 +0,0 @@
/*******************************************************************************
* Copyright 2014-2016, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.entities.projectiles;
import java.util.List;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.api.potion.BOPPotions;
import biomesoplenty.common.item.ItemDart;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.network.play.server.SPacketChangeGameState;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public class EntityDart extends EntityArrow
{
private static final DataParameter<Byte> TYPE = EntityDataManager.<Byte>createKey(EntityDart.class, DataSerializers.BYTE);
private int ticksInAir = 0;
public EntityDart(World world)
{
super(world);
}
public EntityDart(World world, EntityLivingBase shootingEntity)
{
super(world, shootingEntity);
}
public EntityDart(World world, double x, double y, double z)
{
super(world, x, y, z);
}
@Override
protected void entityInit()
{
this.dataManager.register(TYPE, Byte.valueOf((byte)0));
}
public void setDartType(ItemDart.DartType dartType)
{
dataManager.set(TYPE, (byte)dartType.ordinal());
}
public ItemDart.DartType getDartType()
{
return ItemDart.DartType.values()[dataManager.get(TYPE)];
}
// TODO: read/write to NBT?
// Called from onUpdate when it is detected that the dart has hit a solid block
public void onHitSolidBlock()
{
this.playSound(SoundEvents.ENTITY_ARROW_HIT, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
int itemId = Item.getIdFromItem(BOPItems.dart);
int itemMeta = this.getDartType().ordinal();
for (int i = 0; i < 16; ++i)
{
this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {itemId, itemMeta});
}
this.setDead();
}
// Called from onUpdate when it is detected that the dart has hit an entity
public void onHitEntity(Entity entityHit)
{
ItemDart.DartType dartType = this.getDartType();
DamageSource damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity == null ? this : this.shootingEntity);
if (dartType == ItemDart.DartType.POISONDART)
{
if (entityHit instanceof EntityLivingBase)
{
((EntityLivingBase)entityHit).addPotionEffect(new PotionEffect(BOPPotions.paralysis, 100));
}
}
// attempt to damage the entity by the amount in the dartType
boolean entitySufferedHit = entityHit.attackEntityFrom(damagesource, dartType.getDamageInflicted());
if (entitySufferedHit)
{
if (entityHit instanceof EntityLivingBase)
{
EntityLivingBase entitylivingbase = (EntityLivingBase)entityHit;
// TODO: this bit is from the EntityArrow code - what does it do? do we need it?
/*
if (this.shootingEntity instanceof EntityLivingBase)
{
EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
}
*/
// TODO: what is all this? Something about informing the other player in a multiplayer game that he got hit or something?
if (this.shootingEntity != null && entityHit != this.shootingEntity && entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
{
((EntityPlayerMP)this.shootingEntity).connection.sendPacket(new SPacketChangeGameState(6, 0.0F));
}
}
this.playSound(SoundEvents.ENTITY_ARROW_HIT, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.setDead();
}
else
{
// if the entity didn't suffer a hit, the dart bounces off
this.bounceOff();
}
}
// Reverse the dart's direction and (almost) stop it moving
public void bounceOff()
{
this.motionX *= -0.10000000149011612D;
this.motionY *= -0.10000000149011612D;
this.motionZ *= -0.10000000149011612D;
this.rotationYaw += 180.0F;
this.prevRotationYaw += 180.0F;
this.ticksInAir = 0;
}
@Override
public void onUpdate()
{
super.onEntityUpdate();
// Set the initial pitch and yaw according to the direction the dart is fired
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
}
++this.ticksInAir;
Vec3d currentPosision = new Vec3d(this.posX, this.posY, this.posZ);
Vec3d futurePosition = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
// see if there's a block between the current and future positions
RayTraceResult blockCollision = this.worldObj.rayTraceBlocks(currentPosision, futurePosition, false, true, false);
// if there's a block, then correct futurePosition to be the hit surface of the block
if (blockCollision != null)
{
futurePosition = new Vec3d(blockCollision.hitVec.xCoord, blockCollision.hitVec.yCoord, blockCollision.hitVec.zCoord);
}
// get a list of all the entities which are anywhere near getting hit
List<Entity> nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
// loop through the list of nearby entities, and find the closest one who is in line to be hit by the dart on this tick
Entity closestOnTargetEntity = null;
double distanceToClosestOnTargetEntity = Double.POSITIVE_INFINITY;
float entityCollisionTolerance = 0.3F;
for (Entity entity : nearbyEntities)
{
if (entity.canBeCollidedWith() && (entity != this.shootingEntity || this.ticksInAir >= 5))
{
AxisAlignedBB axisalignedbb1 = entity.getEntityBoundingBox().expand((double)entityCollisionTolerance, (double)entityCollisionTolerance, (double)entityCollisionTolerance);
RayTraceResult entityCollision = axisalignedbb1.calculateIntercept(currentPosision, futurePosition);
if (entityCollision != null)
{
// skip players who cannot be hit
if (entity instanceof EntityPlayer)
{
EntityPlayer entityplayer = (EntityPlayer)entity;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
{
continue;
}
}
double distanceToEntity = currentPosision.distanceTo(entityCollision.hitVec);
if (distanceToEntity < distanceToClosestOnTargetEntity)
{
closestOnTargetEntity = entity;
distanceToClosestOnTargetEntity = distanceToEntity;
}
}
}
}
if (closestOnTargetEntity != null)
{
// we hit an entity
this.onHitEntity(closestOnTargetEntity);
}
else if (blockCollision != null)
{
// we hit a block
this.onHitSolidBlock();
}
// continue the movement (taken unaltered from EntityArrow)
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float dartSpeed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)dartSpeed) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float dragFactor = 0.99F;
float accelerationDueToGravity = 0.05F;
if (this.isInWater())
{
for (int l = 0; l < 4; ++l)
{
float f4 = 0.25F;
this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ, new int[0]);
}
dragFactor = 0.6F;
}
this.motionX *= (double)dragFactor;
this.motionY *= (double)dragFactor;
this.motionZ *= (double)dragFactor;
this.motionY -= (double)accelerationDueToGravity;
this.setPosition(this.posX, this.posY, this.posZ);
this.doBlockCollisions();
}
@Override
protected ItemStack getArrowStack()
{
return new ItemStack(BOPItems.dart);
}
}

View file

@ -1,111 +0,0 @@
/*******************************************************************************
* Copyright 2015-2016, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.entities.projectiles;
import org.lwjgl.opengl.GL11;
import biomesoplenty.common.item.ItemDart;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderDart extends Render<EntityDart>
{
protected ResourceLocation[] textures;
public RenderDart(RenderManager renderManager)
{
super(renderManager);
int n = ItemDart.DartType.values().length;
this.textures = new ResourceLocation[n];
for (int i = 0; i < n; ++i)
{
this.textures[i] = new ResourceLocation("biomesoplenty:textures/entity/" + ItemDart.DartType.values()[i].getName() + ".png");
}
}
@Override
public void doRender(EntityDart dart, double x, double y, double z, float entityYaw, float partialTicks)
{
this.bindEntityTexture(dart);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
GlStateManager.rotate(dart.prevRotationYaw + (dart.rotationYaw - dart.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(dart.prevRotationPitch + (dart.rotationPitch - dart.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer worldrenderer = tessellator.getBuffer();
float shaft_u0 = 0.0F;
float shaft_u1 = 0.5F;
float shaft_v0 = 0.0F;
float shaft_v1 = 0.15625F;
float flights_u0 = 0.0F;
float flights_u1 = 0.15625F;
float flights_v0 = 0.15625F;
float flights_v1 = 0.3125F;
float scale = 0.05625F;
GlStateManager.enableRescaleNormal();
// render flights
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(scale, scale, scale);
GlStateManager.translate(-4.0F, 0.0F, 0.0F);
GL11.glNormal3f(scale, 0.0F, 0.0F);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)flights_u0, (double)flights_v0).endVertex();
worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)flights_u1, (double)flights_v0).endVertex();;
worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)flights_u1, (double)flights_v1).endVertex();;
worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)flights_u0, (double)flights_v1).endVertex();;
tessellator.draw();
GL11.glNormal3f(-scale, 0.0F, 0.0F);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)flights_u0, (double)flights_v0).endVertex();;
worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)flights_u1, (double)flights_v0).endVertex();;
worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)flights_u1, (double)flights_v1).endVertex();;
worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)flights_u0, (double)flights_v1).endVertex();;
tessellator.draw();
// render shaft
for (int i = 0; i < 4; ++i)
{
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, scale);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-8.0D, -2.0D, 0.0D).tex((double)shaft_u0, (double)shaft_v0).endVertex();;
worldrenderer.pos(8.0D, -2.0D, 0.0D).tex((double)shaft_u1, (double)shaft_v0).endVertex();;
worldrenderer.pos(8.0D, 2.0D, 0.0D).tex((double)shaft_u1, (double)shaft_v1).endVertex();;
worldrenderer.pos(-8.0D, 2.0D, 0.0D).tex((double)shaft_u0, (double)shaft_v1).endVertex();;
tessellator.draw();
}
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(dart, x, y, z, entityYaw, partialTicks);
}
@Override
protected ResourceLocation getEntityTexture(EntityDart dart)
{
return this.textures[dart.getDartType().ordinal()];
}
}

View file

@ -1,17 +0,0 @@
package biomesoplenty.common.entities.projectiles.dispenser;
import biomesoplenty.common.entities.projectiles.EntityDart;
import net.minecraft.dispenser.BehaviorProjectileDispense;
import net.minecraft.dispenser.IPosition;
import net.minecraft.entity.IProjectile;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class DispenserBehaviorDart extends BehaviorProjectileDispense
{
@Override
protected IProjectile getProjectileEntity(World world, IPosition position, ItemStack stack)
{
return new EntityDart(world, position.getX(), position.getY(), position.getZ());
}
}

View file

@ -231,12 +231,6 @@ public class AchievementEventHandler
player.addStat(BOPAchievements.craft_terrestrial_artifact); player.addStat(BOPAchievements.craft_terrestrial_artifact);
} }
//Darts and Crafts Achievement
if (item != null && item == BOPItems.dart_blower)
{
player.addStat(BOPAchievements.craft_dart_blower);
}
//Pick Your Poison Achievement //Pick Your Poison Achievement
if (item != null && item == new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.POISON.ordinal()).getItem()) if (item != null && item == new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.POISON.ordinal()).getItem())
{ {

View file

@ -9,7 +9,6 @@ package biomesoplenty.common.init;
import static biomesoplenty.api.achievement.BOPAchievements.craft_ambrosia; import static biomesoplenty.api.achievement.BOPAchievements.craft_ambrosia;
import static biomesoplenty.api.achievement.BOPAchievements.craft_amethyst_sword; import static biomesoplenty.api.achievement.BOPAchievements.craft_amethyst_sword;
import static biomesoplenty.api.achievement.BOPAchievements.craft_dart_blower;
import static biomesoplenty.api.achievement.BOPAchievements.craft_flax_string; import static biomesoplenty.api.achievement.BOPAchievements.craft_flax_string;
import static biomesoplenty.api.achievement.BOPAchievements.craft_muddy_pickaxe; import static biomesoplenty.api.achievement.BOPAchievements.craft_muddy_pickaxe;
import static biomesoplenty.api.achievement.BOPAchievements.craft_poison_jar; import static biomesoplenty.api.achievement.BOPAchievements.craft_poison_jar;
@ -65,8 +64,8 @@ public class ModAchievements
obtain_turnip = addAchievement("achievement.obtain_turnip", "obtain_turnip", -1, -6, new ItemStack(BOPItems.turnip), craft_muddy_pickaxe); obtain_turnip = addAchievement("achievement.obtain_turnip", "obtain_turnip", -1, -6, new ItemStack(BOPItems.turnip), craft_muddy_pickaxe);
grow_sacred_oak = addAchievement("achievement.grow_sacred_oak", "grow_sacred_oak", -5, -6, BlockBOPSapling.paging.getVariantItem(BOPTrees.SACRED_OAK), obtain_turnip).setSpecial(); grow_sacred_oak = addAchievement("achievement.grow_sacred_oak", "grow_sacred_oak", -5, -6, BlockBOPSapling.paging.getVariantItem(BOPTrees.SACRED_OAK), obtain_turnip).setSpecial();
craft_flax_string = addAchievement("achievement.craft_flax_string", "craft_flax_string", -4, -4, new ItemStack(BOPItems.flax_string), craft_muddy_pickaxe); craft_flax_string = addAchievement("achievement.craft_flax_string", "craft_flax_string", -4, -4, new ItemStack(BOPItems.flax_string), craft_muddy_pickaxe);
craft_dart_blower = addAchievement("achievement.craft_dart_blower", "craft_dart_blower", -6, -3, new ItemStack(BOPItems.dart_blower), craft_flax_string); //craft_dart_blower = addAchievement("achievement.craft_dart_blower", "craft_dart_blower", -6, -3, new ItemStack(BOPItems.dart_blower), craft_flax_string);
craft_amethyst_sword = addAchievement("achievement.craft_amethyst_sword", "craft_amethyst_sword", -7, 0, new ItemStack(BOPItems.amethyst_sword), craft_dart_blower).setSpecial(); craft_amethyst_sword = addAchievement("achievement.craft_amethyst_sword", "craft_amethyst_sword", -7, 0, new ItemStack(BOPItems.amethyst_sword), craft_flax_string).setSpecial();
obtain_thorn = addAchievement("achievement.obtain_thorn", "obtain_thorn", -3, -1, BlockBOPPlant.paging.getVariantItem(BOPPlants.THORN), obtain_flowers); obtain_thorn = addAchievement("achievement.obtain_thorn", "obtain_thorn", -3, -1, BlockBOPPlant.paging.getVariantItem(BOPPlants.THORN), obtain_flowers);
craft_poison_jar = addAchievement("achievement.craft_poison_jar", "craft_poison_jar", -3, 1, new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.POISON.ordinal()), obtain_thorn); craft_poison_jar = addAchievement("achievement.craft_poison_jar", "craft_poison_jar", -3, 1, new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.POISON.ordinal()), obtain_thorn);

View file

@ -40,7 +40,6 @@ import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.enums.BOPTrees; import biomesoplenty.common.enums.BOPTrees;
import biomesoplenty.common.enums.BOPWoods; import biomesoplenty.common.enums.BOPWoods;
import biomesoplenty.common.handler.FurnaceFuelHandler; import biomesoplenty.common.handler.FurnaceFuelHandler;
import biomesoplenty.common.item.ItemDart;
import biomesoplenty.common.item.ItemJarFilled; import biomesoplenty.common.item.ItemJarFilled;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
@ -189,12 +188,6 @@ public class ModCrafting
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.plain_flower_band), new Object [] {"CDC", "D D", "CDC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER), 'D', BlockBOPFlower.paging.getVariantItem(BOPFlowers.ORANGE_COSMOS)}); GameRegistry.addShapedRecipe(new ItemStack(BOPItems.plain_flower_band), new Object [] {"CDC", "D D", "CDC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER), 'D', BlockBOPFlower.paging.getVariantItem(BOPFlowers.ORANGE_COSMOS)});
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.exotic_flower_band), new Object [] {"CDC", "V V", "CDC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER),'D', BlockBOPFlower.paging.getVariantItem(BOPFlowers.ORANGE_COSMOS), 'V', BlockBOPFlower.paging.getVariantItem(BOPFlowers.VIOLET)}); GameRegistry.addShapedRecipe(new ItemStack(BOPItems.exotic_flower_band), new Object [] {"CDC", "V V", "CDC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER),'D', BlockBOPFlower.paging.getVariantItem(BOPFlowers.ORANGE_COSMOS), 'V', BlockBOPFlower.paging.getVariantItem(BOPFlowers.VIOLET)});
// Dart Blower
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.dart_blower), new Object[] {"R R", "R R", "R R", 'R', BlockBOPPlant.paging.getVariantItem(BOPPlants.RIVERCANE)});
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.dart, 4, ItemDart.DartType.DART.ordinal()), new Object[] {"T", "R", "F", 'T', BlockBOPPlant.paging.getVariantItem(BOPPlants.THORN), 'R', BlockBOPPlant.paging.getVariantItem(BOPPlants.RIVERCANE), 'F', Items.FEATHER});
GameRegistry.addShapelessRecipe(new ItemStack(BOPItems.dart, 1, ItemDart.DartType.POISONDART.ordinal()), new Object[] {new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.POISON.ordinal()), new ItemStack(BOPItems.dart, 1, ItemDart.DartType.DART.ordinal())});
/*** Biome Finder ***/ /*** Biome Finder ***/
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.biome_finder), new Object[] {" A ", "AOA", " A ", 'A', new ItemStack(BOPItems.gem, 1, BOPGems.AMETHYST.ordinal()), 'O', new ItemStack(BOPItems.terrestrial_artifact)}); GameRegistry.addShapedRecipe(new ItemStack(BOPItems.biome_finder), new Object[] {" A ", "AOA", " A ", 'A', new ItemStack(BOPItems.gem, 1, BOPGems.AMETHYST.ordinal()), 'O', new ItemStack(BOPItems.terrestrial_artifact)});

View file

@ -17,7 +17,6 @@ import biomesoplenty.common.entities.EntityButterfly;
import biomesoplenty.common.entities.EntityPixie; import biomesoplenty.common.entities.EntityPixie;
import biomesoplenty.common.entities.EntitySnail; import biomesoplenty.common.entities.EntitySnail;
import biomesoplenty.common.entities.EntityWasp; import biomesoplenty.common.entities.EntityWasp;
import biomesoplenty.common.entities.projectiles.EntityDart;
import biomesoplenty.common.entities.projectiles.EntityMudball; import biomesoplenty.common.entities.projectiles.EntityMudball;
import biomesoplenty.core.BiomesOPlenty; import biomesoplenty.core.BiomesOPlenty;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -40,7 +39,6 @@ public class ModEntities
public static void init() public static void init()
{ {
// projectiles // projectiles
registerBOPEntity(EntityDart.class, "dart", 80, 3, true);
registerBOPEntity(EntityMudball.class, "mudball", 80, 3, true); registerBOPEntity(EntityMudball.class, "mudball", 80, 3, true);
// mobs // mobs

View file

@ -27,8 +27,6 @@ import static biomesoplenty.api.item.BOPItems.black_dye;
import static biomesoplenty.api.item.BOPItems.blue_dye; import static biomesoplenty.api.item.BOPItems.blue_dye;
import static biomesoplenty.api.item.BOPItems.brown_dye; import static biomesoplenty.api.item.BOPItems.brown_dye;
import static biomesoplenty.api.item.BOPItems.crystal_shard; import static biomesoplenty.api.item.BOPItems.crystal_shard;
import static biomesoplenty.api.item.BOPItems.dart;
import static biomesoplenty.api.item.BOPItems.dart_blower;
import static biomesoplenty.api.item.BOPItems.diamond_scythe; import static biomesoplenty.api.item.BOPItems.diamond_scythe;
import static biomesoplenty.api.item.BOPItems.dull_flower_band; import static biomesoplenty.api.item.BOPItems.dull_flower_band;
import static biomesoplenty.api.item.BOPItems.earth; import static biomesoplenty.api.item.BOPItems.earth;
@ -103,8 +101,6 @@ import biomesoplenty.common.item.ItemBOPScythe;
import biomesoplenty.common.item.ItemBOPSpawnEgg; import biomesoplenty.common.item.ItemBOPSpawnEgg;
import biomesoplenty.common.item.ItemBiomeEssence; import biomesoplenty.common.item.ItemBiomeEssence;
import biomesoplenty.common.item.ItemBiomeFinder; import biomesoplenty.common.item.ItemBiomeFinder;
import biomesoplenty.common.item.ItemDart;
import biomesoplenty.common.item.ItemDartBlower;
import biomesoplenty.common.item.ItemEnderporter; import biomesoplenty.common.item.ItemEnderporter;
import biomesoplenty.common.item.ItemFlippers; import biomesoplenty.common.item.ItemFlippers;
import biomesoplenty.common.item.ItemFlowerBand; import biomesoplenty.common.item.ItemFlowerBand;
@ -273,9 +269,6 @@ public class ModItems
diamond_scythe = registerItem(new ItemBOPScythe(ToolMaterial.DIAMOND), "diamond_scythe"); diamond_scythe = registerItem(new ItemBOPScythe(ToolMaterial.DIAMOND), "diamond_scythe");
amethyst_scythe = registerItem(new ItemBOPScythe(amethyst_tool_material), "amethyst_scythe"); amethyst_scythe = registerItem(new ItemBOPScythe(amethyst_tool_material), "amethyst_scythe");
dart = registerItem(new ItemDart(), "dart");
dart_blower = registerItem(new ItemDartBlower(), "dart_blower");
jar_empty = registerItem(new ItemJarEmpty(), "jar_empty"); jar_empty = registerItem(new ItemJarEmpty(), "jar_empty");
jar_filled = registerItem(new ItemJarFilled(), "jar_filled"); jar_filled = registerItem(new ItemJarFilled(), "jar_filled");
flower_basket = registerItem(new ItemFlowerBasket(), "flower_basket"); flower_basket = registerItem(new ItemFlowerBasket(), "flower_basket");

View file

@ -1,7 +1,6 @@
package biomesoplenty.common.init; package biomesoplenty.common.init;
import biomesoplenty.api.item.BOPItems; import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.entities.projectiles.dispenser.DispenserBehaviorDart;
import biomesoplenty.common.entities.projectiles.dispenser.DispenserBehaviorMudball; import biomesoplenty.common.entities.projectiles.dispenser.DispenserBehaviorMudball;
import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockDispenser;
@ -16,7 +15,6 @@ public class ModVanillaCompat
private static void registerDispenserBehaviors() private static void registerDispenserBehaviors()
{ {
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(BOPItems.mudball, new DispenserBehaviorMudball()); BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(BOPItems.mudball, new DispenserBehaviorMudball());
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(BOPItems.dart, new DispenserBehaviorDart());
} }
private static void addDungeonLoot() private static void addDungeonLoot()

View file

@ -139,8 +139,6 @@ public class ThaumcraftCompat
addAspectsToItem(BOPItems.ash, new Aspect[] { Aspect.ENTROPY, Aspect.EXCHANGE }, new int[] { 1, 1 }); addAspectsToItem(BOPItems.ash, new Aspect[] { Aspect.ENTROPY, Aspect.EXCHANGE }, new int[] { 1, 1 });
addAspectsToItem(BOPItems.crystal_shard, new Aspect[] { Aspect.CRYSTAL, Aspect.LIGHT, Aspect.DESIRE }, new int[] { 4, 2, 3 }); addAspectsToItem(BOPItems.crystal_shard, new Aspect[] { Aspect.CRYSTAL, Aspect.LIGHT, Aspect.DESIRE }, new int[] { 4, 2, 3 });
addAspectsToItem(BOPItems.mud_brick, new Aspect[] { Aspect.EARTH, Aspect.FIRE }, new int[] { 2, 1 }); addAspectsToItem(BOPItems.mud_brick, new Aspect[] { Aspect.EARTH, Aspect.FIRE }, new int[] { 2, 1 });
addAspectsToItemMeta(BOPItems.dart, 0, new Aspect[] { Aspect.AVERSION }, new int[] { 1 });
addAspectsToItemMeta(BOPItems.dart, 1, new Aspect[] { Aspect.AVERSION }, new int[] { 1 });
} }
//Allows Thaumcraft golems to harvest BoP crops //Allows Thaumcraft golems to harvest BoP crops

View file

@ -1,86 +0,0 @@
/*******************************************************************************
* Copyright 2014-2016, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.item;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemDart extends Item
{
public static enum DartType implements IStringSerializable
{
// in order of preference when selecting from inventory to use in the dart blower, items on the right are preferred to items on the left
DART, POISONDART;
@Override
public String getName()
{
return this.name().toLowerCase();
}
@Override
public String toString()
{
return this.getName();
}
public float getDamageInflicted()
{
switch(this)
{
case POISONDART:
return 1.0F;
case DART: default:
return 2.0F;
}
}
public static DartType fromMeta(int meta)
{
return DartType.values()[meta % DartType.values().length];
}
};
public ItemDart()
{
this.setHasSubtypes(true);
this.setMaxDamage(0);
}
// add all the gem types as separate items in the creative tab
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item itemIn, CreativeTabs tab, List subItems)
{
for (DartType dartType : DartType.values())
{
subItems.add(new ItemStack(itemIn, 1, dartType.ordinal()));
}
}
// default behavior in Item is to return 0, but the meta value is important here because it determines which dart type to use
@Override
public int getMetadata(int metadata)
{
return metadata;
}
// get the correct name for this item by looking up the meta value in the DartType enum
@Override
public String getUnlocalizedName(ItemStack stack)
{
return "item." + DartType.fromMeta(stack.getMetadata()).toString();
}
}

View file

@ -1,76 +0,0 @@
/*******************************************************************************
* Copyright 2014-2016, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.item;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.entities.projectiles.EntityDart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.world.World;
public class ItemDartBlower extends Item
{
public ItemDartBlower()
{
this.maxStackSize = 1;
this.setMaxDamage(63);
}
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
{
if (world.isRemote) {return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);}
boolean isCreative = player.capabilities.isCreativeMode;
// look for the best dart in inventory - find out which slot it's in
int bestDartSlot = -1;
ItemDart.DartType bestAvailableDartType = ItemDart.DartType.DART;
for (int k = 0; k < player.inventory.mainInventory.length; ++k)
{
ItemStack current = player.inventory.mainInventory[k];
if (current != null && current.getItem()==BOPItems.dart)
{
ItemDart.DartType currentDartType = ItemDart.DartType.fromMeta(current.getMetadata());
if (currentDartType.ordinal() >= bestAvailableDartType.ordinal())
{
bestAvailableDartType = currentDartType;
bestDartSlot = k;
}
}
}
if (isCreative || (bestDartSlot > -1))
{
// there is a dart available to blow - blow it.
EntityDart entityDart = new EntityDart(world, player);
entityDart.setDartType(bestAvailableDartType);
entityDart.setAim(player, player.rotationPitch, player.rotationYaw, 0.0F, 3.0F, 1.0F);
if (!isCreative)
{
stack.damageItem(1, player);
player.inventory.decrStackSize(bestDartSlot, 1);
}
world.spawnEntityInWorld(entityDart);
world.playSound(player, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.75F);
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
}
}

View file

@ -29,9 +29,7 @@ import biomesoplenty.common.entities.RenderButterfly;
import biomesoplenty.common.entities.RenderPixie; import biomesoplenty.common.entities.RenderPixie;
import biomesoplenty.common.entities.RenderSnail; import biomesoplenty.common.entities.RenderSnail;
import biomesoplenty.common.entities.RenderWasp; import biomesoplenty.common.entities.RenderWasp;
import biomesoplenty.common.entities.projectiles.EntityDart;
import biomesoplenty.common.entities.projectiles.EntityMudball; import biomesoplenty.common.entities.projectiles.EntityMudball;
import biomesoplenty.common.entities.projectiles.RenderDart;
import biomesoplenty.common.entities.projectiles.RenderMudball; import biomesoplenty.common.entities.projectiles.RenderMudball;
import biomesoplenty.common.item.IColoredItem; import biomesoplenty.common.item.IColoredItem;
import biomesoplenty.common.util.inventory.CreativeTabBOP; import biomesoplenty.common.util.inventory.CreativeTabBOP;
@ -79,7 +77,6 @@ public class ClientProxy extends CommonProxy
GuiMainMenu.TITLE_PANORAMA_PATHS = bopTitlePanoramaPaths; GuiMainMenu.TITLE_PANORAMA_PATHS = bopTitlePanoramaPaths;
//Entity rendering and other stuff will go here in future //Entity rendering and other stuff will go here in future
registerEntityRenderer(EntityDart.class, RenderDart.class);
registerEntityRenderer(EntityWasp.class, RenderWasp.class); registerEntityRenderer(EntityWasp.class, RenderWasp.class);
registerEntityRenderer(EntityPixie.class, RenderPixie.class); registerEntityRenderer(EntityPixie.class, RenderPixie.class);
registerEntityRenderer(EntitySnail.class, RenderSnail.class); registerEntityRenderer(EntitySnail.class, RenderSnail.class);

View file

@ -14,8 +14,6 @@ achievement.grow_sacred_oak=Yggdrasil
achievement.grow_sacred_oak.desc=Plant a sacred oak sapling achievement.grow_sacred_oak.desc=Plant a sacred oak sapling
achievement.craft_flax_string=Flaxen Fun achievement.craft_flax_string=Flaxen Fun
achievement.craft_flax_string.desc=Craft flax plants into flax string achievement.craft_flax_string.desc=Craft flax plants into flax string
achievement.craft_dart_blower=Darts and Crafts
achievement.craft_dart_blower.desc=Make a dart blower with river cane
achievement.craft_muddy_pickaxe=Getting a Downgrade achievement.craft_muddy_pickaxe=Getting a Downgrade
achievement.craft_muddy_pickaxe.desc=Build a...muddy pickaxe...? achievement.craft_muddy_pickaxe.desc=Build a...muddy pickaxe...?
achievement.craft_amethyst_sword=True Swordsman achievement.craft_amethyst_sword=True Swordsman
@ -102,8 +100,6 @@ item.cherry_door.name=Cherry Door
item.crystal_shard.name=Celestial Crystal Shard item.crystal_shard.name=Celestial Crystal Shard
item.terrestrial_artifact.name=Terrestrial Artifact item.terrestrial_artifact.name=Terrestrial Artifact
item.flax_string.name=Flax String item.flax_string.name=Flax String
item.dart.name=Dart
item.dart_blower.name=Dart Blower
item.diamond_scythe.name=Diamond Scythe item.diamond_scythe.name=Diamond Scythe
item.dull_flower_band.name=Dull Flower Band item.dull_flower_band.name=Dull Flower Band
item.ebony_door.name=Ebony Door item.ebony_door.name=Ebony Door
@ -162,7 +158,6 @@ item.pine_door.name=Pine Door
item.pixie_dust.name=Pixie Dust item.pixie_dust.name=Pixie Dust
item.plain_flower_band.name=Plain Flower Band item.plain_flower_band.name=Plain Flower Band
item.poison_bucket.name=Poison Bucket item.poison_bucket.name=Poison Bucket
item.poisondart.name=Poison Dart
item.record_corruption.name=Music Disc item.record_corruption.name=Music Disc
item.record.corruption.desc=??? item.record.corruption.desc=???
item.record_wanderer.name=Music Disc item.record_wanderer.name=Music Disc

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/dart"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/dart_blower"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/poisondart"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B