mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 14:24:22 +00:00
Tweak horn sidings
This commit is contained in:
2 files changed
+13
-16
No files matched your search
@@ -115,12 +115,16 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
public void onBurstCollision(IManaBurst burst, World world, BlockPos pos) {
|
||||
if(burst.isFake())
|
||||
return;
|
||||
if(world.isRemote) {
|
||||
world.spawnParticle(EnumParticleTypes.NOTE, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5D, 1.0 / 24.0, 0, 0);
|
||||
return;
|
||||
}
|
||||
DrumVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.DRUM_VARIANT);
|
||||
if(variant == DrumVariant.WILD)
|
||||
ItemGrassHorn.breakGrass(world, null, 0, pos);
|
||||
else if(variant == DrumVariant.CANOPY)
|
||||
ItemGrassHorn.breakGrass(world, null, 1, pos);
|
||||
else if(!world.isRemote) {
|
||||
else {
|
||||
int range = 10;
|
||||
List<EntityLiving> entities = world.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1)));
|
||||
List<EntityLiving> shearables = new ArrayList<>();
|
||||
@@ -166,11 +170,8 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
}
|
||||
}
|
||||
|
||||
if(!world.isRemote)
|
||||
for(int i = 0; i < 10; i++)
|
||||
world.playSound(null, pos, SoundEvents.BLOCK_NOTE_BASEDRUM, SoundCategory.BLOCKS, 1F, 1F);
|
||||
else world.spawnParticle(EnumParticleTypes.NOTE, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5D, 1.0 / 24.0, 0, 0);
|
||||
|
||||
for(int i = 0; i < 10; i++)
|
||||
world.playSound(null, pos, SoundEvents.BLOCK_NOTE_BASS, SoundCategory.BLOCKS, 1F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,11 +59,7 @@ public class ItemGrassHorn extends ItemMod {
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return getUnlocalizedNameLazy(par1ItemStack) + par1ItemStack.getItemDamage();
|
||||
}
|
||||
|
||||
String getUnlocalizedNameLazy(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedName(par1ItemStack);
|
||||
return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -86,11 +82,11 @@ public class ItemGrassHorn extends ItemMod {
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityLivingBase player, int time) {
|
||||
if(time != getMaxItemUseDuration(stack) && time % 5 == 0)
|
||||
breakGrass(player.worldObj, stack, stack.getItemDamage(), new BlockPos(player));
|
||||
|
||||
if(!player.worldObj.isRemote)
|
||||
if(!player.worldObj.isRemote) {
|
||||
if(time != getMaxItemUseDuration(stack) && time % 5 == 0)
|
||||
breakGrass(player.worldObj, stack, stack.getItemDamage(), new BlockPos(player));
|
||||
player.worldObj.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_NOTE_BASS, SoundCategory.BLOCKS, 1F, 0.001F);
|
||||
}
|
||||
}
|
||||
|
||||
public static void breakGrass(World world, ItemStack stack, int stackDmg, BlockPos srcPos) {
|
||||
@@ -121,7 +117,7 @@ public class ItemGrassHorn extends ItemMod {
|
||||
|
||||
if(block instanceof IHornHarvestable && ((IHornHarvestable) block).hasSpecialHornHarvest(world, currCoords, stack, type))
|
||||
((IHornHarvestable) block).harvestByHorn(world, currCoords, stack, type);
|
||||
else if(!world.isRemote) {
|
||||
else {
|
||||
world.setBlockToAir(currCoords);
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
world.playEvent(2001, currCoords, Block.getStateId(state));
|
||||
|
||||
Reference in new issue
Block a user