Removed tiny cacti and mud ball entity, fixed stack sizes for mud balls/music disc
This commit is contained in:
parent
89783dc592
commit
3efcf8059f
|
@ -1,12 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2019, 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.client.render;
|
|
||||||
|
|
||||||
public class RenderMudBall
|
|
||||||
{
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2019, 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.entity.projectile;
|
|
||||||
|
|
||||||
import biomesoplenty.api.entity.BOPEntities;
|
|
||||||
import biomesoplenty.api.item.BOPItems;
|
|
||||||
import biomesoplenty.api.particle.BOPParticleTypes;
|
|
||||||
import biomesoplenty.core.BiomesOPlenty;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
import net.minecraft.entity.LivingEntity;
|
|
||||||
import net.minecraft.entity.projectile.ProjectileItemEntity;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.math.EntityRayTraceResult;
|
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
|
|
||||||
public class EntityMudBall extends ProjectileItemEntity
|
|
||||||
{
|
|
||||||
public EntityMudBall(EntityType<? extends EntityMudBall> type, World world)
|
|
||||||
{
|
|
||||||
super(type, world);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMudBall(World world, double x, double y, double z)
|
|
||||||
{
|
|
||||||
super((EntityType<? extends EntityMudBall>)BOPEntities.mud_ball, x, y, z, world);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMudBall(World world, LivingEntity thrower)
|
|
||||||
{
|
|
||||||
super((EntityType<? extends EntityMudBall>)BOPEntities.mud_ball, thrower, world);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Item func_213885_i()
|
|
||||||
{
|
|
||||||
return BOPItems.mud_ball;
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void handleStatusUpdate(byte id)
|
|
||||||
{
|
|
||||||
if (id == 3)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < 8; ++i)
|
|
||||||
{
|
|
||||||
BiomesOPlenty.proxy.spawnParticle(BOPParticleTypes.MUD, this.world, this.posX, this.posY, this.posZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onImpact(RayTraceResult hit)
|
|
||||||
{
|
|
||||||
if (hit.getType() == RayTraceResult.Type.ENTITY)
|
|
||||||
{
|
|
||||||
Entity entity = ((EntityRayTraceResult)hit).getEntity();
|
|
||||||
entity.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.world.isRemote)
|
|
||||||
{
|
|
||||||
this.world.setEntityState(this, (byte)3);
|
|
||||||
this.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2019, 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.common.entity.projectile.EntityMudBall;
|
|
||||||
import biomesoplenty.common.util.inventory.ItemGroupBOP;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.stats.Stats;
|
|
||||||
import net.minecraft.util.*;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class ItemMudBall extends Item
|
|
||||||
{
|
|
||||||
public ItemMudBall()
|
|
||||||
{
|
|
||||||
super(new Item.Properties().group(ItemGroupBOP.instance).maxStackSize(16));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand)
|
|
||||||
{
|
|
||||||
ItemStack stack = player.getHeldItem(hand);
|
|
||||||
if (!player.abilities.isCreativeMode)
|
|
||||||
{
|
|
||||||
stack.setCount(stack.getCount() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
world.playSound(player, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F));
|
|
||||||
|
|
||||||
if (!world.isRemote)
|
|
||||||
{
|
|
||||||
EntityMudBall mud_ball = new EntityMudBall(world, player);
|
|
||||||
mud_ball.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F);
|
|
||||||
world.addEntity(mud_ball);
|
|
||||||
}
|
|
||||||
|
|
||||||
player.addStat(Stats.ITEM_USED.get(this));
|
|
||||||
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, stack);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue